home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume15 / gnuplot2 / patch04 < prev    next >
Encoding:
Text File  |  1990-10-05  |  76.0 KB  |  2,658 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: eln272v@monu1.cc.monash.edu.au
  3. from: Russell Lang <rjl@monu1.cc.monash.edu.au>
  4. subject: v15i019: gnuplot 2.0 patch 1 (4 of 4)
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 15, Issue 19
  8. Submitted-by: Russell Lang <rjl@monu1.cc.monash.edu.au>
  9. Archive-name: gnuplot2/patch04
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of shell archive."
  18. # Contents:  patch1c
  19. # Wrapped by eln272v@monu1 on Tue Sep 18 14:53:08 1990
  20. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  21. if test -f patch1c -a "${1}" != "-c" ; then 
  22.   echo shar: Will not over-write existing file \"patch1c\"
  23. else
  24. echo shar: Extracting \"patch1c\" \(73914 characters\)
  25. sed "s/^X//" >patch1c <<'END_OF_patch1c'
  26. Xdiff -c ./term/eepic.trm ../patch/term/eepic.trm
  27. X*** ./term/eepic.trm    Tue Mar 27 09:03:33 1990
  28. X--- ../patch/term/eepic.trm    Wed Sep 12 09:38:06 1990
  29. X***************
  30. X*** 44,51
  31. X  #define EEPIC_UNIT (EEPIC_PTS_PER_INCH/DOTS_PER_INCH) /* dot size in pt */
  32. X  
  33. X  /* 5 inches wide by 3 inches high (default) */
  34. X! #define EEPIC_XMAX (unsigned int)(EEPIC_PTS_PER_INCH/EEPIC_UNIT*5.0)
  35. X! #define EEPIC_YMAX (unsigned int)(EEPIC_PTS_PER_INCH/EEPIC_UNIT*3.0)
  36. X  
  37. X  #define EEPIC_HTIC (5./EEPIC_UNIT)
  38. X  #define EEPIC_VTIC (5./EEPIC_UNIT)
  39. X
  40. X--- 44,51 -----
  41. X  #define EEPIC_UNIT (EEPIC_PTS_PER_INCH/DOTS_PER_INCH) /* dot size in pt */
  42. X  
  43. X  /* 5 inches wide by 3 inches high (default) */
  44. X! #define EEPIC_XMAX (5*DOTS_PER_INCH)  /* (EEPIC_PTS_PER_INCH/EEPIC_UNIT*5.0) */
  45. X! #define EEPIC_YMAX (3*DOTS_PER_INCH)  /* (EEPIC_PTS_PER_INCH/EEPIC_UNIT*3.0) */
  46. X  
  47. X  #define EEPIC_HTIC (5*DOTS_PER_INCH/72)        /* (5./EEPIC_UNIT) */
  48. X  #define EEPIC_VTIC (5*DOTS_PER_INCH/72)        /* (5./EEPIC_UNIT) */
  49. X***************
  50. X*** 47,56
  51. X  #define EEPIC_XMAX (unsigned int)(EEPIC_PTS_PER_INCH/EEPIC_UNIT*5.0)
  52. X  #define EEPIC_YMAX (unsigned int)(EEPIC_PTS_PER_INCH/EEPIC_UNIT*3.0)
  53. X  
  54. X! #define EEPIC_HTIC (5./EEPIC_UNIT)
  55. X! #define EEPIC_VTIC (5./EEPIC_UNIT)
  56. X! #define EEPIC_HCHAR (5.3/EEPIC_UNIT)
  57. X! #define EEPIC_VCHAR (11./EEPIC_UNIT)
  58. X  
  59. X  static unsigned int EEPIC_posx;
  60. X  static unsigned int EEPIC_posy;
  61. X
  62. X--- 47,56 -----
  63. X  #define EEPIC_XMAX (5*DOTS_PER_INCH)  /* (EEPIC_PTS_PER_INCH/EEPIC_UNIT*5.0) */
  64. X  #define EEPIC_YMAX (3*DOTS_PER_INCH)  /* (EEPIC_PTS_PER_INCH/EEPIC_UNIT*3.0) */
  65. X  
  66. X! #define EEPIC_HTIC (5*DOTS_PER_INCH/72)        /* (5./EEPIC_UNIT) */
  67. X! #define EEPIC_VTIC (5*DOTS_PER_INCH/72)        /* (5./EEPIC_UNIT) */
  68. X! #define EEPIC_HCHAR (DOTS_PER_INCH*53/10/72)    /* (5.3/EEPIC_UNIT) */
  69. X! #define EEPIC_VCHAR (DOTS_PER_INCH*11/72)    /* (11./EEPIC_UNIT) */
  70. X  
  71. X  static unsigned int EEPIC_posx;
  72. X  static unsigned int EEPIC_posy;
  73. X***************
  74. X*** 92,97
  75. X  static int EEPIC_type;        /* current line type */
  76. X  static BOOLEAN EEPIC_inline = FALSE; /* are we in the middle of a line */
  77. X  static void EEPIC_endline();    /* terminate any line in progress */
  78. X  
  79. X  /* ARROWS */
  80. X  /* we use the same code as for LATEX */
  81. X
  82. X--- 92,99 -----
  83. X  static int EEPIC_type;        /* current line type */
  84. X  static BOOLEAN EEPIC_inline = FALSE; /* are we in the middle of a line */
  85. X  static void EEPIC_endline();    /* terminate any line in progress */
  86. X+ static int EEPIC_linecount = 0; /* number of points in line so far */
  87. X+ #define EEPIC_LINEMAX 50        /* max value for linecount */
  88. X  
  89. X  /* ARROWS */
  90. X  /* we use the same code as for LATEX */
  91. X***************
  92. X*** 181,186
  93. X         fprintf(outfile, "%s(%u,%u)", 
  94. X               EEPIC_lines[EEPIC_type+2], 
  95. X               EEPIC_posx, EEPIC_posy);
  96. X      }
  97. X  
  98. X      /* add new point to line */
  99. X
  100. X--- 183,201 -----
  101. X         fprintf(outfile, "%s(%u,%u)", 
  102. X               EEPIC_lines[EEPIC_type+2], 
  103. X               EEPIC_posx, EEPIC_posy);
  104. X+        EEPIC_linecount = 1;
  105. X+     } else {
  106. X+        /* Even though we are in middle of a path, 
  107. X+         * we may want to start a new path command. 
  108. X+         * If they are too long then latex will choke.
  109. X+         */
  110. X+        if (EEPIC_linecount++ >= EEPIC_LINEMAX) {
  111. X+           fprintf(outfile, "\n");
  112. X+           fprintf(outfile, "%s(%u,%u)", 
  113. X+                 EEPIC_lines[EEPIC_type+2], 
  114. X+                 EEPIC_posx, EEPIC_posy);
  115. X+           EEPIC_linecount = 1;
  116. X+        }
  117. X      }
  118. X      fprintf(outfile, "(%u,%u)", ux,uy);
  119. X      EEPIC_posx = ux;
  120. X***************
  121. X*** 182,189
  122. X               EEPIC_lines[EEPIC_type+2], 
  123. X               EEPIC_posx, EEPIC_posy);
  124. X      }
  125. X- 
  126. X-     /* add new point to line */
  127. X      fprintf(outfile, "(%u,%u)", ux,uy);
  128. X      EEPIC_posx = ux;
  129. X      EEPIC_posy = uy;
  130. X
  131. X--- 197,202 -----
  132. X            EEPIC_linecount = 1;
  133. X         }
  134. X      }
  135. X      fprintf(outfile, "(%u,%u)", ux,uy);
  136. X      EEPIC_posx = ux;
  137. X      EEPIC_posy = uy;
  138. Xdiff -c ./term/eps60.trm ../patch/term/eps60.trm
  139. X*** ./term/eps60.trm    Mon Sep  3 16:07:23 1990
  140. X--- ../patch/term/eps60.trm    Mon Sep  3 15:54:14 1990
  141. X***************
  142. X*** 0
  143. X
  144. X--- 1,106 -----
  145. X+ #ifdef EPS60
  146. X+ 
  147. X+ /* make the total dimensions 8 inches by 5 inches */
  148. X+ #define EPS60XMAX    480
  149. X+ #define EPS60YMAX    360
  150. X+ 
  151. X+ #define EPS60XLAST (EPS60XMAX - 1)
  152. X+ #define EPS60YLAST (EPS60YMAX - 1)
  153. X+ 
  154. X+ EPS60init()
  155. X+ {
  156. X+ char filename[MAX_ID_LEN+1];
  157. X+     bm_xmax=EPS60XMAX;
  158. X+     bm_ymax=EPS60YMAX;
  159. X+     bm_planes=1;        /* one plane */
  160. X+     bm_value=1;
  161. X+     bm_setup();
  162. X+     /* output for EPSON must be binary to stop non Unix computers
  163. X+         changing \n to \r\n. 
  164. X+         At present we only do this for PC's. 
  165. X+         (Ultrix generates a run time error on the "wb" mode).
  166. X+         if the output is not STDOUT, then the following code 
  167. X+         reopens outfile with binary mode. */
  168. X+ #ifdef PC
  169. X+     if (strcmp(outstr,"STDOUT")) {
  170. X+         (void) fclose(outfile);
  171. X+         (void) strcpy(filename,outstr+1);    /* remove quotes */
  172. X+         filename[strlen(filename)-1] = '\0';
  173. X+         if ( (outfile = fopen(filename,"wb")) == (FILE *)NULL ) {
  174. X+             if ( (outfile = fopen(filename,"w")) == (FILE *)NULL ) {
  175. X+                 os_error("cannot reopen file with binary type; output unknown",
  176. X+                     NO_CARET);
  177. X+             } 
  178. X+             else {
  179. X+     os_error("cannot reopen file with binary type; output reset to ascii", 
  180. X+                     NO_CARET);
  181. X+             }
  182. X+         }
  183. X+     }
  184. X+ #endif
  185. X+ }
  186. X+ 
  187. X+ 
  188. X+ /* output file must be binary mode for eps60_dump */
  189. X+ eps60_dump()
  190. X+ {
  191. X+ unsigned int x;
  192. X+ int j,k;
  193. X+ int num_bits = (sizeof(unsigned int)-1)*8;
  194. X+ #ifdef PC
  195. X+     fprintf(stderr,"Dumping Epson-style 60-dpi graphics (21kbytes)\n");
  196. X+ #endif
  197. X+     fprintf(outfile,"\0333\030"); /* set line spacing to 24/216" = 8 dots */
  198. X+     for (j=bm_ipc-1;j>=0;j--) {
  199. X+         for (k=num_bits;k>=0;k-=8) {
  200. X+             /* select printer graphics mode 'K' */
  201. X+             fprintf(outfile,"\r\n\033K");
  202. X+             (void) fputc((char)(bm_xmax%256),outfile);
  203. X+             (void) fputc((char)(bm_xmax/256),outfile);
  204. X+             for (x=0; x<bm_xmax; x++) {
  205. X+                 (void) fputc( (char)((bm_array[x*bm_ipc+j] >>k) &0xff), outfile );
  206. X+             }
  207. X+         }
  208. X+     }
  209. X+     fprintf(outfile,"\0333\044\r\n");  /* set line spacing to 36/216" = 1/6" */
  210. X+ #ifdef PC
  211. X+     fprintf(stderr,"Print using: COPY /B\n");
  212. X+ #endif
  213. X+ }
  214. X+ 
  215. X+ 
  216. X+ EPS60text()
  217. X+ {
  218. X+     eps60_dump();
  219. X+ }
  220. X+ 
  221. X+ 
  222. X+ #endif /* EPS60 */
  223. X+ 
  224. X+ 
  225. X+ 
  226. X+ 
  227. X+ #ifdef TANDY60
  228. X+ 
  229. X+ /* The only difference between TANDY60 and EPS60 is the inclusion
  230. X+    of codes to swap the Tandy printer into IBM mode and back
  231. X+    into Tandy mode.  For a Tandy already in IBM mode, use EPS60. */
  232. X+ 
  233. X+ 
  234. X+ TANDY60text()
  235. X+ {
  236. X+ #ifdef PC
  237. X+     fprintf(stderr, "Inserting Tandy/IBM mode conversion codes\n");
  238. X+ #endif
  239. X+     /* Switch to IBM mode, and leave 3 inches above the plot so as
  240. X+        to get rough vertical centring on the page.  Perform the
  241. X+        centring by setting 1" line feeds and issuing 3 of them. */
  242. X+     fprintf(outfile, "\033!\0333%c\n\n\n", 216);
  243. X+     eps60_dump();
  244. X+     /* A form feed must be sent before switching back to Tandy mode,
  245. X+        or else the form setting will be messed up. */
  246. X+     fprintf(outfile, "\f\033!");
  247. X+ }
  248. X+ 
  249. X+ 
  250. X+ #endif  /* TANDY60 */
  251. Xdiff -c ./term/epson.trm ../patch/term/epson.trm
  252. X*** ./term/epson.trm    Tue Mar 27 09:02:27 1990
  253. X--- ../patch/term/epson.trm    Wed Aug 29 10:04:57 1990
  254. X***************
  255. X*** 696,698
  256. X  
  257. X  #endif /* NEC */
  258. X  
  259. X
  260. X--- 696,890 -----
  261. X  
  262. X  #endif /* NEC */
  263. X  
  264. X+ /* The following Star color driver uses generic bit mapped graphics
  265. X+    routines to build up a bit map in memory. */
  266. X+ /* Core from Epson driver by Russell Lang, eln272v@monu1.cc.monash.oz */
  267. X+ /* Star Color changes made by William Wilson, wew@naucse.cse.nau.edu */
  268. X+ /* On PC, print using 'copy file /b lpt1:', do NOT use 'print' */
  269. X+ /* STARC_init changes outfile to binary mode on PC's */
  270. X+ 
  271. X+ #ifdef STARC
  272. X+ #ifndef EPSON
  273. X+ #define EPSON
  274. X+ #endif
  275. X+ 
  276. X+ /* EPSON must be defined */
  277. X+ 
  278. X+ #define STARCXMAX    400 
  279. X+ #define STARCYMAX    320
  280. X+ 
  281. X+ #define STARCXLAST (STARCXMAX - 1)
  282. X+ #define STARCYLAST (STARCYMAX - 1)
  283. X+ 
  284. X+ #define STARCVCHAR        11      
  285. X+ #define STARCHCHAR        7        
  286. X+ #define STARCVTIC        6
  287. X+ #define STARCHTIC        6
  288. X+ 
  289. X+ /* plane 0=black, 1=cyan(blue), 2=magenta(red), 3=yellow */
  290. X+ static unsigned int STARCcolor[] = {1,8,4,2,10,12,6,14};
  291. X+ static unsigned int STARCpcolor[]= {0,2,1,4};
  292. X+ unsigned int STARC_x=0, STARC_y=0;
  293. X+ int STARC_angle=0;
  294. X+ 
  295. X+ STARCinit()
  296. X+ {
  297. X+ char filename[MAX_ID_LEN+1];
  298. X+   bm_planes=4;
  299. X+     bm_xmax=STARCXMAX;
  300. X+     bm_ymax=STARCYMAX;
  301. X+     bm_value=1;                /* black */
  302. X+     bm_line_mask=0xffff;    /* solid lines */
  303. X+     bm_setup();
  304. X+     /* output for STARC must be binary to stop non Unix computers
  305. X+         changing \n to \r\n. 
  306. X+         At present we only do this for PC's. 
  307. X+         (Ultrix generates a run time error on the "wb" mode).
  308. X+         if the output is not STDOUT, then the following code 
  309. X+         reopens outfile with binary mode. */
  310. X+ #ifdef PC
  311. X+     if (strcmp(outstr,"STDOUT")) {
  312. X+         (void) fclose(outfile);
  313. X+         (void) strcpy(filename,outstr+1);    /* remove quotes */
  314. X+         filename[strlen(filename)-1] = '\0';
  315. X+         if ( (outfile = fopen(filename,"wb")) == (FILE *)NULL) {
  316. X+             if ( (outfile = fopen(filename,"w")) == (FILE *)NULL ) {
  317. X+                 os_error("cannot reopen file with binary type; output unknown",
  318. X+                     NO_CARET);
  319. X+             } 
  320. X+             else {
  321. X+     os_error("cannot reopen file with binary type; output reset to ascii", 
  322. X+                     NO_CARET);
  323. X+             }
  324. X+         }
  325. X+     }
  326. X+ #endif
  327. X+ }
  328. X+ 
  329. X+ 
  330. X+ STARCgraphics()
  331. X+ {
  332. X+ unsigned int plane;
  333. X+ unsigned int fill=0;
  334. X+     for (plane=0; plane<bm_planes; plane++)
  335. X+         bm_cls(plane,fill);
  336. X+     STARC_x=0;
  337. X+     STARC_y=0;
  338. X+     STARC_angle=0;
  339. X+ }
  340. X+ 
  341. X+ 
  342. X+ STARCtext()
  343. X+ {
  344. X+     STARC_dump();
  345. X+ }
  346. X+ 
  347. X+ 
  348. X+ STARClinetype(linetype)
  349. X+ int linetype;
  350. X+ {
  351. X+     if (linetype>=6)
  352. X+         linetype %= 6;
  353. X+     bm_value=STARCcolor[linetype+2];
  354. X+ }
  355. X+ 
  356. X+ 
  357. X+ STARCmove(x,y)
  358. X+ unsigned int x,y;
  359. X+ {
  360. X+     STARC_x=x;
  361. X+     STARC_y=y;
  362. X+ }
  363. X+ 
  364. X+ 
  365. X+ STARCvector(x,y)
  366. X+ unsigned int x,y;
  367. X+ {
  368. X+     bm_line(STARC_x,x,STARC_y,y);
  369. X+     STARC_x=x;
  370. X+     STARC_y=y;
  371. X+ }
  372. X+ 
  373. X+ 
  374. X+ STARCput_text(x,y,str)
  375. X+ unsigned int x, y;
  376. X+ char *str;
  377. X+ {
  378. X+     if (STARC_angle == 1)
  379. X+         x += STARCVCHAR/2;
  380. X+     else
  381. X+         y -= STARCVCHAR/2;
  382. X+    switch (STARC_angle) {
  383. X+       case 0:
  384. X+          for (; *str; ++str, x += STARCHCHAR)
  385. X+             bm_putc (x, y, *str, STARC_angle);
  386. X+                     break;
  387. X+       case 1:
  388. X+          for (; *str; ++str, y += STARCHCHAR)
  389. X+             bm_putc (x, y, *str, STARC_angle);
  390. X+                     break;
  391. X+     }
  392. X+ }
  393. X+ 
  394. X+ 
  395. X+ int STARC_text_angle(ang)
  396. X+ int ang;
  397. X+ {
  398. X+     STARC_angle=ang;
  399. X+     return TRUE;
  400. X+ }
  401. X+ 
  402. X+     
  403. X+ STARCreset()
  404. X+ {
  405. X+     bm_release();
  406. X+ }
  407. X+ 
  408. X+ 
  409. X+ /* output file must be binary mode for STARC_dump */
  410. X+ STARC_dump()
  411. X+ {
  412. X+ unsigned int x;
  413. X+ unsigned int plane,offset;
  414. X+ int j,k;
  415. X+ int num_bits = (sizeof(unsigned int)-1)*8; 
  416. X+ unsigned int column8;
  417. X+ unsigned long column24;
  418. X+ char column3, column2, column1;
  419. X+ #ifdef PC
  420. X+ /*    if (bm_planes==4)*/
  421. X+         fprintf(stderr,"Dumping STAR color graphics (65 kbytes)\n");
  422. X+ #endif
  423. X+     fprintf(outfile,"\033A\010"); /* set line spacing to 8/72" = 8 dots */
  424. X+     for (j=bm_ipc-1;j>=0;j--) {
  425. X+         for (k=num_bits;k>=0;k-=8) {
  426. X+             fprintf(outfile,"\n");
  427. X+             for (plane=0; plane<bm_planes; plane++) {
  428. X+                 offset=plane*bm_psize;
  429. X+                 if (bm_planes>1) {
  430. X+                     /* select colour for plane */
  431. X+                     fprintf(outfile,"\033r");
  432. X+                     (void) fputc((char)STARCpcolor[plane],outfile);
  433. X+                     fprintf(outfile,"\r");
  434. X+                 }
  435. X+                 /* select plotter graphics mode (square pixels) */
  436. X+                 fprintf(outfile,"\r\033*\005");
  437. X+                 (void) fputc((char)(bm_xmax%256),outfile);
  438. X+                 (void) fputc((char)(bm_xmax/256),outfile);
  439. X+                 for (x=0; x<bm_xmax; x++) {
  440. X+                     (void) fputc( (char)((bm_array[offset+x*bm_ipc+j] >>k) &0xff), outfile);
  441. X+                 }
  442. X+             }
  443. X+         }
  444. X+     }
  445. X+     if (bm_planes > 1) {
  446. X+         fprintf(outfile,"\033r");
  447. X+         (void) fputc('\0',outfile);                /* set color to black */
  448. X+     }
  449. X+     fprintf(outfile,"\033A\014\r\n");    /* setline spacing to 12/72" */
  450. X+ #ifdef PC
  451. X+     fprintf(stderr,"Print using: COPY /B\n");
  452. X+ #endif
  453. X+ }
  454. X+ 
  455. X+ #endif /* STARC */
  456. Xdiff -c ./term/hpgl.trm ../patch/term/hpgl.trm
  457. X*** ./term/hpgl.trm    Tue Mar 27 09:02:36 1990
  458. X--- ../patch/term/hpgl.trm    Wed Sep 12 09:10:47 1990
  459. X***************
  460. X*** 33,40
  461. X  #define HPGL_YLAST (HPGL_XMAX - 1)
  462. X  
  463. X  /* HPGL_VCHAR, HPGL_HCHAR  are not used */
  464. X! #define HPGL_VCHAR    (int)(HPGL_YMAX*0.032+0.5) /* 3.2% */
  465. X! #define HPGL_HCHAR    (int)(HPGL_XMAX*0.012+0.5) /* 1.2% */
  466. X  #define HPGL_VTIC    (HPGL_YMAX/70)        
  467. X  #define HPGL_HTIC    (HPGL_YMAX/70)        
  468. X  
  469. X
  470. X--- 33,40 -----
  471. X  #define HPGL_YLAST (HPGL_XMAX - 1)
  472. X  
  473. X  /* HPGL_VCHAR, HPGL_HCHAR  are not used */
  474. X! #define HPGL_VCHAR    (HPGL_YMAX/100*32/10) /* 3.2% */
  475. X! #define HPGL_HCHAR    (HPGL_XMAX/100*12/10) /* 1.2% */
  476. X  #define HPGL_VTIC    (HPGL_YMAX/70)        
  477. X  #define HPGL_HTIC    (HPGL_YMAX/70)        
  478. X  
  479. Xdiff -c ./term/hpljet.trm ../patch/term/hpljet.trm
  480. X*** ./term/hpljet.trm    Tue Mar 27 09:02:43 1990
  481. X--- ../patch/term/hpljet.trm    Tue Aug 28 21:00:50 1990
  482. X***************
  483. X*** 397,404
  484. X  {
  485. X  }
  486. X  
  487. X! /* put_text was added by Russell Lang, eln272v@monu1.cc.monash.oz
  488. X!  * IT IS UNTESTED
  489. X   */
  490. X  /* Put text "str" at pixel position x,y
  491. X  **/
  492. X
  493. X--- 397,404 -----
  494. X  {
  495. X  }
  496. X  
  497. X! /* put_text was added by Russell Lang, rjl@monu1.cc.monash.edu.au
  498. X!  * Tested and repaired by Steve Wampler sbw@naucse.cse.nau.edu
  499. X   */
  500. X  /* Put text "str" at pixel position x,y
  501. X  **/
  502. X***************
  503. X*** 407,413
  504. X  char str[];
  505. X  {
  506. X      fprintf(outfile, "\033&a%dH\033&a%dV",
  507. X!             HPLJET_PX2DP(x), HPLJET_PX2DP(y) );
  508. X      fputs(str, outfile);
  509. X  }
  510. X      
  511. X
  512. X--- 407,415 -----
  513. X  char str[];
  514. X  {
  515. X      fprintf(outfile, "\033&a%dH\033&a%dV",
  516. X!             HPLJET_LMARG+HPLJET_PX2DP(x),
  517. X!         HPLJET_PX2DP(HPLJETYMAX) + HPLJET_VC2DP(2) + 30 -
  518. X!             HPLJET_PX2DP(y) );
  519. X      fputs(str, outfile);
  520. X  }
  521. X      
  522. X***************
  523. X*** 411,446
  524. X      fputs(str, outfile);
  525. X  }
  526. X      
  527. X- 
  528. X- /*
  529. X- ** Put text "str" to the lower right corner of the screen.
  530. X- ** "row" is the row number [0:1].
  531. X- ** Actually in the laserjet, put the text above the upper right corner.
  532. X- */
  533. X- HPLJETlrput_text(row,str)
  534. X- unsigned int row;
  535. X- char str[];
  536. X- {
  537. X-     
  538. X-     fprintf(outfile, "\033&a%dH\033&a%dV",
  539. X-             HPLJET_RMARG - HPLJET_HC2DP(strlen(str)), HPLJET_VC2DP(row));
  540. X-     fputs(str, outfile);
  541. X- }
  542. X- 
  543. X- /*
  544. X- ** Put text "str" to the upper left corner of the screen.
  545. X- ** "row" is the (serial) number of function to be plotted.
  546. X- ** Actually in the laserjet, put the text under the lower left corner.
  547. X- */
  548. X- HPLJETulput_text(row,str)
  549. X- unsigned int row;
  550. X- char str[];
  551. X- {
  552. X-     fprintf(outfile, "\033&a%dH\033&a%dV",
  553. X-             HPLJET_LMARG,
  554. X-             HPLJET_VC2DP(row+3)+HPLJET_PX2DP(HPLJETYMAX));
  555. X-     fputs(str, outfile);
  556. X- }
  557. X  
  558. X  /*
  559. X  ** RETURN to normal mode (exit gnuplot)
  560. X
  561. X--- 413,418 -----
  562. X      fputs(str, outfile);
  563. X  }
  564. X      
  565. X  
  566. X  /*
  567. X  ** RETURN to normal mode (exit gnuplot)
  568. Xdiff -c ./term/imagen.trm ../patch/term/imagen.trm
  569. X*** ./term/imagen.trm    Tue Mar 27 09:03:23 1990
  570. X--- ../patch/term/imagen.trm    Wed Sep 12 09:39:37 1990
  571. X***************
  572. X*** 39,46
  573. X  
  574. X  #define IMAGEN_PTS_PER_INCH (300)
  575. X  
  576. X! #define IMAGEN_XMAX (10.0 * IMAGEN_PTS_PER_INCH) /* 10.0 inches */
  577. X! #define IMAGEN_YMAX (7.5 * IMAGEN_PTS_PER_INCH) /* 7.5 inches */
  578. X  
  579. X  #define IMAGEN_FONTSIZE 12
  580. X  
  581. X
  582. X--- 39,46 -----
  583. X  
  584. X  #define IMAGEN_PTS_PER_INCH (300)
  585. X  
  586. X! #define IMAGEN_XMAX (IMAGEN_PTS_PER_INCH * 10) /* 10.0 inches */
  587. X! #define IMAGEN_YMAX (IMAGEN_PTS_PER_INCH * 75 / 10) /* 7.5 inches */
  588. X  
  589. X  #define IMAGEN_FONTSIZE 12
  590. X  
  591. Xdiff -c ./term/latex.trm ../patch/term/latex.trm
  592. X*** ./term/latex.trm    Tue Mar 27 09:03:31 1990
  593. X--- ../patch/term/latex.trm    Wed Sep 12 09:27:09 1990
  594. X***************
  595. X*** 17,23
  596. X   * This file is included by ../term.c.
  597. X   *
  598. X   * This terminal driver supports:
  599. X!  *   LaTeX pictures
  600. X   *
  601. X   * AUTHORS
  602. X   *   David Kotz, Russell Lang
  603. X
  604. X--- 17,24 -----
  605. X   * This file is included by ../term.c.
  606. X   *
  607. X   * This terminal driver supports:
  608. X!  *   LaTeX pictures (latex).
  609. X!  *   LaTeX pictures with emTeX specials (emtex). 
  610. X   *
  611. X   * AUTHORS
  612. X   *   David Kotz, Russell Lang
  613. X***************
  614. X*** 39,46
  615. X  #define LATEX_UNIT (LATEX_PTS_PER_INCH/DOTS_PER_INCH) /* dot size in pt */
  616. X  
  617. X  /* 5 inches wide by 3 inches high (default) */
  618. X! #define LATEX_XMAX (unsigned int)(LATEX_PTS_PER_INCH/LATEX_UNIT*5.0)
  619. X! #define LATEX_YMAX (unsigned int)(LATEX_PTS_PER_INCH/LATEX_UNIT*3.0)
  620. X  
  621. X  #define LATEX_HTIC (5./LATEX_UNIT)
  622. X  #define LATEX_VTIC (5./LATEX_UNIT)
  623. X
  624. X--- 40,47 -----
  625. X  #define LATEX_UNIT (LATEX_PTS_PER_INCH/DOTS_PER_INCH) /* dot size in pt */
  626. X  
  627. X  /* 5 inches wide by 3 inches high (default) */
  628. X! #define LATEX_XMAX (5*DOTS_PER_INCH)  /* (LATEX_PTS_PER_INCH/LATEX_UNIT*5.0) */
  629. X! #define LATEX_YMAX (3*DOTS_PER_INCH)  /* (LATEX_PTS_PER_INCH/LATEX_UNIT*3.0) */
  630. X  
  631. X  #define LATEX_HTIC (5*DOTS_PER_INCH/72)        /* (5./LATEX_UNIT) */
  632. X  #define LATEX_VTIC (5*DOTS_PER_INCH/72)        /* (5./LATEX_UNIT) */
  633. X***************
  634. X*** 42,51
  635. X  #define LATEX_XMAX (unsigned int)(LATEX_PTS_PER_INCH/LATEX_UNIT*5.0)
  636. X  #define LATEX_YMAX (unsigned int)(LATEX_PTS_PER_INCH/LATEX_UNIT*3.0)
  637. X  
  638. X! #define LATEX_HTIC (5./LATEX_UNIT)
  639. X! #define LATEX_VTIC (5./LATEX_UNIT)
  640. X! #define LATEX_HCHAR (5.3/LATEX_UNIT)
  641. X! #define LATEX_VCHAR (11./LATEX_UNIT)
  642. X  
  643. X  static int LATEX_posx;
  644. X  static int LATEX_posy;
  645. X
  646. X--- 43,52 -----
  647. X  #define LATEX_XMAX (5*DOTS_PER_INCH)  /* (LATEX_PTS_PER_INCH/LATEX_UNIT*5.0) */
  648. X  #define LATEX_YMAX (3*DOTS_PER_INCH)  /* (LATEX_PTS_PER_INCH/LATEX_UNIT*3.0) */
  649. X  
  650. X! #define LATEX_HTIC (5*DOTS_PER_INCH/72)        /* (5./LATEX_UNIT) */
  651. X! #define LATEX_VTIC (5*DOTS_PER_INCH/72)        /* (5./LATEX_UNIT) */
  652. X! #define LATEX_HCHAR (DOTS_PER_INCH*53/10/72)    /* (5.3/LATEX_UNIT) */
  653. X! #define LATEX_VCHAR (DOTS_PER_INCH*11/72)    /* (11./LATEX_UNIT) */
  654. X  
  655. X  static int LATEX_posx;
  656. X  static int LATEX_posy;
  657. X***************
  658. X*** 60,66
  659. X  /* POINTS */
  660. X  #define LATEX_POINT_TYPES 12    /* we supply more point types */
  661. X  static char *LATEX_points[] = {
  662. X!     "\\makebox(0,0){$\\Diamond$}",
  663. X      "\\makebox(0,0){$+$}",
  664. X      "\\makebox(0,0){$\\Box$}",
  665. X      "\\makebox(0,0){$\\times$}",
  666. X
  667. X--- 61,67 -----
  668. X  /* POINTS */
  669. X  #define LATEX_POINT_TYPES 12    /* we supply more point types */
  670. X  static char *LATEX_points[] = {
  671. X!     "\\raisebox{-1.2pt}{\\makebox(0,0){$\\Diamond$}}",
  672. X      "\\makebox(0,0){$+$}",
  673. X      "\\raisebox{-1.2pt}{\\makebox(0,0){$\\Box$}}",
  674. X      "\\makebox(0,0){$\\times$}",
  675. X***************
  676. X*** 62,68
  677. X  static char *LATEX_points[] = {
  678. X      "\\makebox(0,0){$\\Diamond$}",
  679. X      "\\makebox(0,0){$+$}",
  680. X!     "\\makebox(0,0){$\\Box$}",
  681. X      "\\makebox(0,0){$\\times$}",
  682. X      "\\makebox(0,0){$\\triangle$}",
  683. X      "\\makebox(0,0){$\\star$}",
  684. X
  685. X--- 63,69 -----
  686. X  static char *LATEX_points[] = {
  687. X      "\\raisebox{-1.2pt}{\\makebox(0,0){$\\Diamond$}}",
  688. X      "\\makebox(0,0){$+$}",
  689. X!     "\\raisebox{-1.2pt}{\\makebox(0,0){$\\Box$}}",
  690. X      "\\makebox(0,0){$\\times$}",
  691. X      "\\makebox(0,0){$\\triangle$}",
  692. X      "\\makebox(0,0){$\\star$}",
  693. X***************
  694. X*** 78,89
  695. X      float size;            /* size of dot, or thick of line in points */
  696. X      float dotspace;            /* inter-dot space in points; 0 for lines */
  697. X  } LATEX_lines[] = {
  698. X!     {.4, 0},                /* thin solid line */
  699. X!     {1.0, 0},                /* thick solid line */
  700. X!     {2.0, 0},                /* Thick solid line */
  701. X!     {.4, 5},                /* dotted line */
  702. X!     {.4, 10},                /* widely dotted line */
  703. X!     {.4, 15}                /* really widely dotted line */
  704. X  };
  705. X  /* for drawing dotted and solid lines */
  706. X  static void LATEX_dot_line();
  707. X
  708. X--- 79,90 -----
  709. X      float size;            /* size of dot, or thick of line in points */
  710. X      float dotspace;            /* inter-dot space in points; 0 for lines */
  711. X  } LATEX_lines[] = {
  712. X!     {.4, 0.0},                /* thin solid line */
  713. X!     {1.0, 0.0},                /* thick solid line */
  714. X!     {2.0, 0.0},                /* Thick solid line */
  715. X!     {.4, 5.0},                /* dotted line */
  716. X!     {.4, 10.0},                /* widely dotted line */
  717. X!     {.4, 15.0}                /* really widely dotted line */
  718. X  };
  719. X  /* for drawing dotted and solid lines */
  720. X  static void LATEX_dot_line();
  721. X***************
  722. X*** 93,98
  723. X  static BOOLEAN LATEX_moved = TRUE;    /* pen is up after move */
  724. X  static float LATEX_dotsize;    /* size of LATEX_DOT in units */
  725. X  
  726. X  /* ARROWS */
  727. X  /* the set of non-vertical/non-horizontal LaTeX vector slopes */
  728. X  /* except negatives - they are handled specially */
  729. X
  730. X--- 94,104 -----
  731. X  static BOOLEAN LATEX_moved = TRUE;    /* pen is up after move */
  732. X  static float LATEX_dotsize;    /* size of LATEX_DOT in units */
  733. X  
  734. X+ #ifdef EMTEX
  735. X+ BOOLEAN emtex=FALSE; /* not currently using emtex */
  736. X+ static void EMTEX_solid_line();
  737. X+ #endif
  738. X+ 
  739. X  /* ARROWS */
  740. X  /* the set of non-vertical/non-horizontal LaTeX vector slopes */
  741. X  /* except negatives - they are handled specially */
  742. X***************
  743. X*** 109,114
  744. X  
  745. X  LATEX_init()
  746. X  {
  747. X      LATEX_posx = LATEX_posy = 0;
  748. X      LATEX_linetype(-1);
  749. X      fprintf(outfile, "%% GNUPLOT: LaTeX picture\n");
  750. X
  751. X--- 115,123 -----
  752. X  
  753. X  LATEX_init()
  754. X  {
  755. X+ #ifdef EMTEX
  756. X+     emtex = FALSE;
  757. X+ #endif
  758. X      LATEX_posx = LATEX_posy = 0;
  759. X      LATEX_linetype(-1);
  760. X      fprintf(outfile, "%% GNUPLOT: LaTeX picture\n");
  761. X***************
  762. X*** 152,157
  763. X      if (linetype >= LATEX_LINE_TYPES)
  764. X       linetype %= LATEX_LINE_TYPES;
  765. X  
  766. X      LATEX_flushrule();
  767. X  
  768. X      if (linetype >= 0 && 
  769. X
  770. X--- 161,169 -----
  771. X      if (linetype >= LATEX_LINE_TYPES)
  772. X       linetype %= LATEX_LINE_TYPES;
  773. X  
  774. X+ #ifdef EMTEX
  775. X+     if (!emtex)
  776. X+ #endif
  777. X      LATEX_flushrule();
  778. X  
  779. X      if (linetype >= 0 && 
  780. X***************
  781. X*** 155,167
  782. X      LATEX_flushrule();
  783. X  
  784. X      if (linetype >= 0 && 
  785. X!        LATEX_lines[linetype].size != LATEX_lines[LATEX_type].size) 
  786. X!      /* redefine \plotpoint */
  787. X!      fprintf(outfile, "\\sbox{\\plotpoint}{\\rule[%.3fpt]{%.3fpt}{%.3fpt}}\n",
  788. X!             -LATEX_lines[linetype].size/2,
  789. X!             LATEX_lines[linetype].size,
  790. X!             LATEX_lines[linetype].size);
  791. X! 
  792. X      LATEX_type = linetype;
  793. X      LATEX_dotsize = LATEX_lines[linetype].size / LATEX_UNIT;
  794. X      LATEX_moved = TRUE;            /* reset */
  795. X
  796. X--- 167,187 -----
  797. X      LATEX_flushrule();
  798. X  
  799. X      if (linetype >= 0 && 
  800. X!        (LATEX_type < 0 ||
  801. X!         LATEX_lines[linetype].size != LATEX_lines[LATEX_type].size)) {
  802. X!         /* redefine \plotpoint */
  803. X!         fprintf(outfile, 
  804. X!             "\\sbox{\\plotpoint}{\\rule[%.3fpt]{%.3fpt}{%.3fpt}}%%\n",
  805. X!             -LATEX_lines[linetype].size/2,
  806. X!             LATEX_lines[linetype].size,
  807. X!             LATEX_lines[linetype].size);
  808. X! #ifdef EMTEX
  809. X!         if (emtex)         /* change line width */
  810. X!             fprintf(outfile, "\\special{em:linewidth %.1fpt}%%\n",
  811. X!                 LATEX_lines[linetype].size);
  812. X! #endif
  813. X!     }
  814. X!     
  815. X      LATEX_type = linetype;
  816. X      LATEX_dotsize 
  817. X       = ((linetype >= 0) ? LATEX_lines[linetype].size / LATEX_UNIT : 0);
  818. X***************
  819. X*** 163,169
  820. X              LATEX_lines[linetype].size);
  821. X  
  822. X      LATEX_type = linetype;
  823. X!     LATEX_dotsize = LATEX_lines[linetype].size / LATEX_UNIT;
  824. X      LATEX_moved = TRUE;            /* reset */
  825. X  }
  826. X  
  827. X
  828. X--- 183,190 -----
  829. X      }
  830. X      
  831. X      LATEX_type = linetype;
  832. X!     LATEX_dotsize 
  833. X!      = ((linetype >= 0) ? LATEX_lines[linetype].size / LATEX_UNIT : 0);
  834. X      LATEX_moved = TRUE;            /* reset */
  835. X  }
  836. X  
  837. X***************
  838. X*** 209,215
  839. X         }
  840. X      } else {                /* drawing real curves */
  841. X         if (LATEX_lines[LATEX_type].dotspace == 0.0)
  842. X!         LATEX_solid_line(LATEX_posx, (int)ux, LATEX_posy, (int)uy);
  843. X         else
  844. X          LATEX_dot_line(LATEX_posx, (int)ux, LATEX_posy, (int)uy);
  845. X      }
  846. X
  847. X--- 230,241 -----
  848. X         }
  849. X      } else {                /* drawing real curves */
  850. X         if (LATEX_lines[LATEX_type].dotspace == 0.0)
  851. X! #ifdef EMTEX
  852. X!         if (emtex)
  853. X!            EMTEX_solid_line(LATEX_posx, (int)ux, LATEX_posy, (int)uy);
  854. X!         else
  855. X! #endif
  856. X!            LATEX_solid_line(LATEX_posx, (int)ux, LATEX_posy, (int)uy);
  857. X         else
  858. X          LATEX_dot_line(LATEX_posx, (int)ux, LATEX_posy, (int)uy);
  859. X      }
  860. X***************
  861. X*** 301,315
  862. X       if (width == 0 || height == 0)
  863. X         return;            /* ignore this rule */
  864. X  
  865. X-     if (width < 0) {
  866. X-        x += width;
  867. X-        width = -width;
  868. X-     }
  869. X-     if (height < 0) {
  870. X-        y += height;
  871. X-        height = -height;
  872. X-     }
  873. X- 
  874. X      if (valid && combine) {
  875. X         /* try to combine new rule with old rule */
  876. X         if ((int)lastx == (int)x && lastw == width) { /* vertical rule */
  877. X
  878. X--- 327,332 -----
  879. X       if (width == 0 || height == 0)
  880. X         return;            /* ignore this rule */
  881. X  
  882. X      if (valid && combine) {
  883. X         /* try to combine new rule with old rule */
  884. X         if ((int)lastx == (int)x && lastw == width) { /* vertical rule */
  885. X***************
  886. X*** 313,320
  887. X      if (valid && combine) {
  888. X         /* try to combine new rule with old rule */
  889. X         if ((int)lastx == (int)x && lastw == width) { /* vertical rule */
  890. X!           lasth += height;
  891. X!           return;
  892. X         } else if ((int)lasty == (int)y && lasth == height){ /* horiz rule */
  893. X            lastw += width;
  894. X            return;
  895. X
  896. X--- 330,339 -----
  897. X      if (valid && combine) {
  898. X         /* try to combine new rule with old rule */
  899. X         if ((int)lastx == (int)x && lastw == width) { /* vertical rule */
  900. X!           if (lasth * height >= 0) { /* same sign */
  901. X!              lasth += height;
  902. X!              return;
  903. X!           }
  904. X         } else if ((int)lasty == (int)y && lasth == height){ /* horiz rule */
  905. X            if (lastw * width >= 0) { /* same sign */
  906. X               lastw += width;
  907. X***************
  908. X*** 316,323
  909. X            lasth += height;
  910. X            return;
  911. X         } else if ((int)lasty == (int)y && lasth == height){ /* horiz rule */
  912. X!           lastw += width;
  913. X!           return;
  914. X         }
  915. X         /* oh well, output last and remember the new one */
  916. X      }
  917. X
  918. X--- 335,344 -----
  919. X               return;
  920. X            }
  921. X         } else if ((int)lasty == (int)y && lasth == height){ /* horiz rule */
  922. X!           if (lastw * width >= 0) { /* same sign */
  923. X!              lastw += width;
  924. X!              return;
  925. X!           }
  926. X         }
  927. X         /* oh well, output last and remember the new one */
  928. X      }
  929. X***************
  930. X*** 322,336
  931. X         /* oh well, output last and remember the new one */
  932. X      }
  933. X  
  934. X!     if (valid)
  935. X!      /* if very small use canned dot */
  936. X!      if (lastw < LATEX_dotsize || lasth < LATEX_dotsize)
  937. X!        fprintf(outfile, "\\put(%d,%d){%s}\n",       
  938. X!              (int)lastx, (int)lasty, LATEX_DOT);
  939. X!      else
  940. X!        fprintf(outfile, "\\put(%d,%d){\\rule[%.3fpt]{%.3fpt}{%.3fpt}}\n",
  941. X!              (int)lastx, (int)lasty, -LATEX_dotsize*LATEX_UNIT/2,
  942. X!              lastw*LATEX_UNIT, lasth*LATEX_UNIT);
  943. X      
  944. X      if (flush) {
  945. X         valid = FALSE;
  946. X
  947. X--- 343,368 -----
  948. X         /* oh well, output last and remember the new one */
  949. X      }
  950. X  
  951. X!     if (valid) {
  952. X!        /* output the rule */
  953. X!        if (lastw < 0) {
  954. X!           lastx += lastw;
  955. X!           lastw = -lastw;
  956. X!        }
  957. X!        if (lasth < 0) {
  958. X!           lasty += lasth;
  959. X!           lasth = -lasth;
  960. X!        }
  961. X! 
  962. X!        /* if very small use canned dot */
  963. X!        if (lastw < LATEX_dotsize || lasth < LATEX_dotsize)
  964. X!         fprintf(outfile, "\\put(%d,%d){%s}\n",       
  965. X!                (int)lastx, (int)lasty, LATEX_DOT);
  966. X!        else
  967. X!         fprintf(outfile, "\\put(%d,%d){\\rule[%.3fpt]{%.3fpt}{%.3fpt}}\n",
  968. X!                (int)lastx, (int)lasty, -LATEX_dotsize*LATEX_UNIT/2,
  969. X!                lastw*LATEX_UNIT, lasth*LATEX_UNIT);
  970. X!     }
  971. X      
  972. X      if (flush) {
  973. X         valid = FALSE;
  974. X***************
  975. X*** 418,424
  976. X      int x, y;                /* points near sx,sy */
  977. X      float m;                /* slope of line */
  978. X      float arrowslope;        /* slope of arrow */
  979. X!     float minerror;            /* best-case error */
  980. X      struct vslope *slope;    /* one of the slopes */
  981. X      struct vslope *bestslope;    /* the slope with min error */
  982. X      BOOLEAN horiz;            /* was it the horiz line that was best? */
  983. X
  984. X--- 450,456 -----
  985. X      int x, y;                /* points near sx,sy */
  986. X      float m;                /* slope of line */
  987. X      float arrowslope;        /* slope of arrow */
  988. X!     float minerror = 0;        /* best-case error */
  989. X      struct vslope *slope;    /* one of the slopes */
  990. X      struct vslope *bestslope;    /* the slope with min error */
  991. X      BOOLEAN horiz;            /* was it the horiz line that was best? */
  992. X***************
  993. X*** 440,445
  994. X          * we try to find the closest-slope arrowhead.
  995. X          */
  996. X         bestslope = NULL;
  997. X         m = abs((float)dy/dx); /* the slope we want */
  998. X         for (slope = LATEX_slopes; slope->dx != 0.0; slope++) {
  999. X            /* find the slope of the arrow */
  1000. X
  1001. X--- 472,478 -----
  1002. X          * we try to find the closest-slope arrowhead.
  1003. X          */
  1004. X         bestslope = NULL;
  1005. X+        minerror = 0; /* to shut up turbo C */
  1006. X         m = abs((float)dy/dx); /* the slope we want */
  1007. X         for (slope = LATEX_slopes; slope->dx != 0.0; slope++) {
  1008. X            /* find the slope of the arrow */
  1009. X***************
  1010. X*** 459,465
  1011. X                 abs(ex-sx));
  1012. X         else {
  1013. X            /* we draw the line the usual way, with thin lines */
  1014. X!           if (who == 1) {
  1015. X               LATEX_linetype(LATEX_THIN_LINE);
  1016. X               LATEX_solid_line(sx,ex,sy,ey);
  1017. X            }
  1018. X
  1019. X--- 492,499 -----
  1020. X                 abs(ex-sx));
  1021. X         else {
  1022. X            /* we draw the line the usual way, with thin lines */
  1023. X! #ifdef EMTEX
  1024. X!           if (emtex) {
  1025. X               LATEX_linetype(LATEX_THIN_LINE);
  1026. X               EMTEX_solid_line(sx,ex,sy,ey);
  1027. X            } else 
  1028. X***************
  1029. X*** 461,468
  1030. X            /* we draw the line the usual way, with thin lines */
  1031. X            if (who == 1) {
  1032. X               LATEX_linetype(LATEX_THIN_LINE);
  1033. X!              LATEX_solid_line(sx,ex,sy,ey);
  1034. X!           }
  1035. X  #ifdef EEPIC
  1036. X            else {
  1037. X               EEPIC_move(sx,sy);
  1038. X
  1039. X--- 495,507 -----
  1040. X  #ifdef EMTEX
  1041. X            if (emtex) {
  1042. X               LATEX_linetype(LATEX_THIN_LINE);
  1043. X!              EMTEX_solid_line(sx,ex,sy,ey);
  1044. X!           } else 
  1045. X! #endif
  1046. X!             if (who == 1) {
  1047. X!                LATEX_linetype(LATEX_THIN_LINE);
  1048. X!                LATEX_solid_line(sx,ex,sy,ey);
  1049. X!             }
  1050. X  #ifdef EEPIC
  1051. X              else {
  1052. X                 EEPIC_move(sx,sy);
  1053. X***************
  1054. X*** 464,473
  1055. X               LATEX_solid_line(sx,ex,sy,ey);
  1056. X            }
  1057. X  #ifdef EEPIC
  1058. X!           else {
  1059. X!              EEPIC_move(sx,sy);
  1060. X!              EEPIC_vector(ex,ey);
  1061. X!           }
  1062. X  #endif /* EEPIC */
  1063. X            /* and then draw an arrowhead (a short vector) there */
  1064. X            fprintf(outfile, "\\put(%d,%d){\\vector(%d,%d){0}}\n",
  1065. X
  1066. X--- 503,512 -----
  1067. X                 LATEX_solid_line(sx,ex,sy,ey);
  1068. X              }
  1069. X  #ifdef EEPIC
  1070. X!             else {
  1071. X!                EEPIC_move(sx,sy);
  1072. X!                EEPIC_vector(ex,ey);
  1073. X!             }
  1074. X  #endif /* EEPIC */
  1075. X            /* and then draw an arrowhead (a short vector) there */
  1076. X            fprintf(outfile, "\\put(%d,%d){\\vector(%d,%d){0}}\n",
  1077. X***************
  1078. X*** 555,557
  1079. X      LATEX_posx = LATEX_posy = 0;
  1080. X  }
  1081. X  
  1082. X
  1083. X--- 594,638 -----
  1084. X      LATEX_posx = LATEX_posy = 0;
  1085. X  }
  1086. X  
  1087. X+ 
  1088. X+ #ifdef EMTEX
  1089. X+ 
  1090. X+ EMTEX_init()
  1091. X+ {
  1092. X+     emtex=TRUE;
  1093. X+     LATEX_posx = LATEX_posy = 0;
  1094. X+     fprintf(outfile, "%% GNUPLOT: LaTeX picture with emtex specials\n");
  1095. X+     fprintf(outfile, "\\setlength{\\unitlength}{%fpt}\n", LATEX_UNIT);
  1096. X+     LATEX_linetype(-1);
  1097. X+ }
  1098. X+ 
  1099. X+ 
  1100. X+ EMTEX_reset()
  1101. X+ {
  1102. X+     emtex=FALSE;
  1103. X+     LATEX_posx = LATEX_posy = 0;
  1104. X+ }
  1105. X+ 
  1106. X+ 
  1107. X+ EMTEX_text()
  1108. X+ {
  1109. X+     fprintf(outfile, "\\end{picture}\n");
  1110. X+ }
  1111. X+ 
  1112. X+ 
  1113. X+ static void
  1114. X+ EMTEX_solid_line(x1,x2, y1,y2)
  1115. X+     int x1,x2, y1,y2;
  1116. X+ {
  1117. X+     /* emtex special solid line */
  1118. X+     if (LATEX_moved)
  1119. X+         fprintf(outfile, "\\put(%d,%d){\\special{em:moveto}}\n", x1, y1);
  1120. X+     if ( (x1!=x2) || (y1!=y2) )
  1121. X+         fprintf(outfile, "\\put(%d,%d){\\special{em:lineto}}\n", x2, y2);
  1122. X+     LATEX_posx = x2;
  1123. X+     LATEX_posy = y2;
  1124. X+     LATEX_moved = FALSE;
  1125. X+ }
  1126. X+ 
  1127. X+ 
  1128. X+ #endif /* EMTEX */
  1129. Xdiff -c ./term/pc.trm ../patch/term/pc.trm
  1130. X*** ./term/pc.trm    Tue Mar 27 09:03:04 1990
  1131. X--- ../patch/term/pc.trm    Tue Aug 28 20:52:11 1990
  1132. X***************
  1133. X*** 20,26
  1134. X   *  Under Microsoft C
  1135. X   *      cga, egabios, egalib, vgabios, hercules, corona325, att
  1136. X   *  Under Turboc C
  1137. X!  *      egalib, vgalib, vgamono, mcga, cga, hercules
  1138. X   *
  1139. X   * AUTHORS
  1140. X   *  Colin Kelley, Thomas Williams, William Wilson, Russell Lang
  1141. X
  1142. X--- 20,26 -----
  1143. X   *  Under Microsoft C
  1144. X   *      cga, egabios, egalib, vgabios, hercules, corona325, att
  1145. X   *  Under Turboc C
  1146. X!  *      egalib, vgalib, vgamono, mcga, cga, hercules, att
  1147. X   *
  1148. X   * AUTHORS
  1149. X   *  Colin Kelley, Thomas Williams, William Wilson, Russell Lang
  1150. X***************
  1151. X*** 110,116
  1152. X              pixelon = (((unsigned int)(font5x7[i][j])) >> k & 1);
  1153. X              if (pixelon) {
  1154. X                  switch(angle) {
  1155. X!                     case 0 : line_func(x+k+1,y-j,x+k+1,y-j);
  1156. X                              break;
  1157. X                      case 1 : line_func(x-j,y-k-1,x-j,y-k-1);
  1158. X                              break;
  1159. X
  1160. X--- 110,116 -----
  1161. X              pixelon = (((unsigned int)(font5x7[i][j])) >> k & 1);
  1162. X              if (pixelon) {
  1163. X                  switch(angle) {
  1164. X!                     case 0 : (*line_func)(x+k+1,y-j,x+k+1,y-j);
  1165. X                              break;
  1166. X                      case 1 : (*line_func)(x-j,y-k-1,x-j,y-k-1);
  1167. X                              break;
  1168. X***************
  1169. X*** 112,118
  1170. X                  switch(angle) {
  1171. X                      case 0 : line_func(x+k+1,y-j,x+k+1,y-j);
  1172. X                              break;
  1173. X!                     case 1 : line_func(x-j,y-k-1,x-j,y-k-1);
  1174. X                              break;
  1175. X                  }
  1176. X              }
  1177. X
  1178. X--- 112,118 -----
  1179. X                  switch(angle) {
  1180. X                      case 0 : (*line_func)(x+k+1,y-j,x+k+1,y-j);
  1181. X                              break;
  1182. X!                     case 1 : (*line_func)(x-j,y-k-1,x-j,y-k-1);
  1183. X                              break;
  1184. X                  }
  1185. X              }
  1186. X***************
  1187. X*** 1197,1202
  1188. X      outtextxy(x,HERC_YLAST-y,buf);
  1189. X  }
  1190. X  
  1191. X  
  1192. X  #endif /* ifndef __TURBOC__ */
  1193. X  
  1194. X
  1195. X--- 1197,1301 -----
  1196. X      outtextxy(x,HERC_YLAST-y,buf);
  1197. X  }
  1198. X  
  1199. X+ 
  1200. X+ #ifdef ATT6300
  1201. X+ /* this driver added by rjl@monu1.cc.monash.edu.au */
  1202. X+ 
  1203. X+ #define ATT_XMAX 640
  1204. X+ #define ATT_YMAX 400
  1205. X+ 
  1206. X+ #define ATT_XLAST (ATT_XMAX - 1)
  1207. X+ #define ATT_YLAST (ATT_YMAX - 1)
  1208. X+ 
  1209. X+ #define ATT_VCHAR PC_VCHAR
  1210. X+ #define ATT_HCHAR PC_HCHAR
  1211. X+ #define ATT_VTIC 4
  1212. X+ #define ATT_HTIC 5
  1213. X+ 
  1214. X+ #define ATT_text_angle PC_text_angle
  1215. X+ #define ATT_justify_text PC_justify_text
  1216. X+ #define ATT_reset PC_reset
  1217. X+ 
  1218. X+ ATT_init()
  1219. X+ {
  1220. X+     g_driver=ATT400;
  1221. X+     g_mode=5;
  1222. X+       initgraph(&g_driver,&g_mode,path);
  1223. X+           switch (g_driver){
  1224. X+             case -2: fprintf(stderr,"Graphics card not detected.\n");
  1225. X+                      break;
  1226. X+             case -3: fprintf(stderr,"BGI driver file cannot be found.\n");
  1227. X+                      break;
  1228. X+             case -4: fprintf(stderr,"Invalid BGI driver file.\n");
  1229. X+                      break;
  1230. X+             case -5: fprintf(stderr,"Insufficient memory to load ",
  1231. X+                              "graphics driver.");
  1232. X+                      break;
  1233. X+             }
  1234. X+ }
  1235. X+ 
  1236. X+ ATT_graphics()
  1237. X+ {
  1238. X+     g_driver=ATT400;
  1239. X+     g_mode=5;
  1240. X+     initgraph(&g_driver,&g_mode,path);
  1241. X+     ATT_justify_text(LEFT);
  1242. X+     graphics_on = TRUE;
  1243. X+ }
  1244. X+ 
  1245. X+ ATT_text()
  1246. X+ {
  1247. X+     if (graphics_on) {
  1248. X+         graphics_on = FALSE;
  1249. X+         pause();
  1250. X+     }
  1251. X+     closegraph();
  1252. X+ }
  1253. X+ 
  1254. X+ ATT_linetype(linetype)
  1255. X+ {
  1256. X+     if (linetype >= 5)
  1257. X+         linetype %= 5;
  1258. X+     setlinestyle(4,pattern[linetype+2],1);
  1259. X+ }
  1260. X+ 
  1261. X+ ATT_move(x,y)
  1262. X+ {
  1263. X+     if (x < 0)
  1264. X+         x = 0;
  1265. X+     else if (x > ATT_XLAST)
  1266. X+         x = ATT_XLAST;
  1267. X+ 
  1268. X+     if (y < 0)
  1269. X+         y = 0;
  1270. X+     else if (y > ATT_YLAST)
  1271. X+         y = ATT_YLAST;
  1272. X+     moveto(x,getmaxy()-y);
  1273. X+ }
  1274. X+ 
  1275. X+ ATT_vector(x,y)
  1276. X+ {
  1277. X+     if (x < 0)
  1278. X+         x = 0;
  1279. X+     else if (x > ATT_XLAST)
  1280. X+         x = ATT_XLAST;
  1281. X+     if (y < 0)
  1282. X+         y = 0;
  1283. X+     else if (y > ATT_YLAST)
  1284. X+         y = ATT_YLAST;
  1285. X+ 
  1286. X+     lineto(x,getmaxy()-y);
  1287. X+ }
  1288. X+ 
  1289. X+ 
  1290. X+ ATT_put_text(x,y,str)
  1291. X+ unsigned int x, y;
  1292. X+ char *str;
  1293. X+ {
  1294. X+     strcpy((char far *)buf,str);
  1295. X+     outtextxy(x,ATT_YLAST-y,buf);
  1296. X+ }
  1297. X+ #endif /* ifdef ATT6300 */
  1298. X  
  1299. X  #endif /* ifndef __TURBOC__ */
  1300. X  
  1301. Xdiff -c ./term/post.trm ../patch/term/post.trm
  1302. X*** ./term/post.trm    Tue Mar 27 09:02:51 1990
  1303. X--- ../patch/term/post.trm    Tue Sep 18 14:40:31 1990
  1304. X***************
  1305. X*** 40,46
  1306. X  "/vpt2 vpt 2 mul def\n",
  1307. X  "/hpt2 hpt 2 mul def\n",
  1308. X  /* flush left show */
  1309. X! "/Lshow { 0 vshift rmoveto show } def\n", 
  1310. X  /* flush right show */
  1311. X  "/Rshow { dup stringwidth pop neg vshift rmoveto show } def\n", 
  1312. X  /* centred show */
  1313. X
  1314. X--- 40,47 -----
  1315. X  "/vpt2 vpt 2 mul def\n",
  1316. X  "/hpt2 hpt 2 mul def\n",
  1317. X  /* flush left show */
  1318. X! "/Lshow { currentpoint stroke moveto\n",
  1319. X! "  0 vshift rmoveto show } def\n", 
  1320. X  /* flush right show */
  1321. X  "/Rshow { currentpoint stroke moveto\n",
  1322. X  "  dup stringwidth pop neg vshift rmoveto show } def\n", 
  1323. X***************
  1324. X*** 42,48
  1325. X  /* flush left show */
  1326. X  "/Lshow { 0 vshift rmoveto show } def\n", 
  1327. X  /* flush right show */
  1328. X! "/Rshow { dup stringwidth pop neg vshift rmoveto show } def\n", 
  1329. X  /* centred show */
  1330. X  "/Cshow { dup stringwidth pop -2 div vshift rmoveto show } def\n", 
  1331. X  /* Border Lines */
  1332. X
  1333. X--- 43,50 -----
  1334. X  "/Lshow { currentpoint stroke moveto\n",
  1335. X  "  0 vshift rmoveto show } def\n", 
  1336. X  /* flush right show */
  1337. X! "/Rshow { currentpoint stroke moveto\n",
  1338. X! "  dup stringwidth pop neg vshift rmoveto show } def\n", 
  1339. X  /* centred show */
  1340. X  "/Cshow { currentpoint stroke moveto\n",
  1341. X  "  dup stringwidth pop -2 div vshift rmoveto show } def\n", 
  1342. X***************
  1343. X*** 44,50
  1344. X  /* flush right show */
  1345. X  "/Rshow { dup stringwidth pop neg vshift rmoveto show } def\n", 
  1346. X  /* centred show */
  1347. X! "/Cshow { dup stringwidth pop -2 div vshift rmoveto show } def\n", 
  1348. X  /* Border Lines */
  1349. X  "/BL { stroke gnulinewidth 2 mul setlinewidth} def\n",
  1350. X  /* Axes Lines */
  1351. X
  1352. X--- 46,53 -----
  1353. X  "/Rshow { currentpoint stroke moveto\n",
  1354. X  "  dup stringwidth pop neg vshift rmoveto show } def\n", 
  1355. X  /* centred show */
  1356. X! "/Cshow { currentpoint stroke moveto\n",
  1357. X! "  dup stringwidth pop -2 div vshift rmoveto show } def\n", 
  1358. X  /* Border Lines */
  1359. X  "/BL { stroke gnulinewidth 2 mul setlinewidth } def\n",
  1360. X  /* Axes Lines */
  1361. X***************
  1362. X*** 46,52
  1363. X  /* centred show */
  1364. X  "/Cshow { dup stringwidth pop -2 div vshift rmoveto show } def\n", 
  1365. X  /* Border Lines */
  1366. X! "/BL { stroke gnulinewidth 2 mul setlinewidth} def\n",
  1367. X  /* Axes Lines */
  1368. X  "/AL { stroke gnulinewidth 2 div setlinewidth } def\n",
  1369. X  /* Plot Lines */
  1370. X
  1371. X--- 49,55 -----
  1372. X  "/Cshow { currentpoint stroke moveto\n",
  1373. X  "  dup stringwidth pop -2 div vshift rmoveto show } def\n", 
  1374. X  /* Border Lines */
  1375. X! "/BL { stroke gnulinewidth 2 mul setlinewidth } def\n",
  1376. X  /* Axes Lines */
  1377. X  "/AL { stroke gnulinewidth 2 div setlinewidth } def\n",
  1378. X  /* Plot Lines */
  1379. X***************
  1380. X*** 102,109
  1381. X  #define PS_HTIC (PS_YMAX/80)
  1382. X  
  1383. X  
  1384. X! #define PS_SC (360.0/PS_XMAX)        /* scale is 1pt = 10 units */
  1385. X! #define    PS_LW (0.25/PS_SC)            /* linewidth = 0.25 pts */
  1386. X  
  1387. X  #define PS_VCHAR1 (int)(7.0/PS_SC)    /* 7 point characters */
  1388. X  #define PS_HCHAR1 (int)(0.6*7.0/PS_SC)
  1389. X
  1390. X--- 105,112 -----
  1391. X  #define PS_HTIC (PS_YMAX/80)
  1392. X  
  1393. X  
  1394. X! #define PS_SC (PS_XMAX/360)        /* scale is 1pt = 10 units */
  1395. X! #define    PS_LW (0.25*PS_SC)        /* linewidth = 0.25 pts */
  1396. X  
  1397. X  #define PS_VCHAR1 (7*PS_SC)        /* 7 point characters */
  1398. X  #define PS_HCHAR1 (7*PS_SC*6/10)
  1399. X***************
  1400. X*** 105,112
  1401. X  #define PS_SC (360.0/PS_XMAX)        /* scale is 1pt = 10 units */
  1402. X  #define    PS_LW (0.25/PS_SC)            /* linewidth = 0.25 pts */
  1403. X  
  1404. X! #define PS_VCHAR1 (int)(7.0/PS_SC)    /* 7 point characters */
  1405. X! #define PS_HCHAR1 (int)(0.6*7.0/PS_SC)
  1406. X  
  1407. X  #define PS_VCHAR2 (int)(11.0/PS_SC)    /* 11 point characters */
  1408. X  #define PS_HCHAR2 (int)(0.6*11.0/PS_SC)
  1409. X
  1410. X--- 108,115 -----
  1411. X  #define PS_SC (PS_XMAX/360)        /* scale is 1pt = 10 units */
  1412. X  #define    PS_LW (0.25*PS_SC)        /* linewidth = 0.25 pts */
  1413. X  
  1414. X! #define PS_VCHAR1 (7*PS_SC)        /* 7 point characters */
  1415. X! #define PS_HCHAR1 (7*PS_SC*6/10)
  1416. X  
  1417. X  #define PS_VCHAR2 (11*PS_SC)        /* 11 point characters */
  1418. X  #define PS_HCHAR2 (11*PS_SC*6/10)
  1419. X***************
  1420. X*** 108,115
  1421. X  #define PS_VCHAR1 (int)(7.0/PS_SC)    /* 7 point characters */
  1422. X  #define PS_HCHAR1 (int)(0.6*7.0/PS_SC)
  1423. X  
  1424. X! #define PS_VCHAR2 (int)(11.0/PS_SC)    /* 11 point characters */
  1425. X! #define PS_HCHAR2 (int)(0.6*11.0/PS_SC)
  1426. X  
  1427. X  
  1428. X  EPSF1_init()
  1429. X
  1430. X--- 111,118 -----
  1431. X  #define PS_VCHAR1 (7*PS_SC)        /* 7 point characters */
  1432. X  #define PS_HCHAR1 (7*PS_SC*6/10)
  1433. X  
  1434. X! #define PS_VCHAR2 (11*PS_SC)        /* 11 point characters */
  1435. X! #define PS_HCHAR2 (11*PS_SC*6/10)
  1436. X  
  1437. X  
  1438. X  EPSF1_init()
  1439. X***************
  1440. X*** 135,142
  1441. X      fprintf(outfile,"%%%%DocumentFonts: %s\n", ps_font);
  1442. X      fprintf(outfile,"%%%%DocumentNeededFonts: %s\n", ps_font);
  1443. X      fprintf(outfile,"%%%%BoundingBox: 0 0 %d %d\n",
  1444. X!         (int)(xsize*(PS_XMAX)*PS_SC+0.5), 
  1445. X!         (int)(ysize*(PS_YMAX)*PS_SC+0.5) );
  1446. X      fprintf(outfile,"%%%%EndComments\n");
  1447. X      fprintf(outfile,"40 dict begin\n");
  1448. X      fprintf(outfile,"/gnulinewidth %.3f def\n",PS_LW);
  1449. X
  1450. X--- 138,145 -----
  1451. X      fprintf(outfile,"%%%%DocumentFonts: %s\n", ps_font);
  1452. X      fprintf(outfile,"%%%%DocumentNeededFonts: %s\n", ps_font);
  1453. X      fprintf(outfile,"%%%%BoundingBox: 0 0 %d %d\n",
  1454. X!         (int)(xsize*(PS_XMAX)/PS_SC+0.5), 
  1455. X!         (int)(ysize*(PS_YMAX)/PS_SC+0.5) );
  1456. X      fprintf(outfile,"%%%%EndComments\n");
  1457. X      fprintf(outfile,"40 dict begin\n");
  1458. X      fprintf(outfile,"/gnulinewidth %.3f def\n",PS_LW);
  1459. X***************
  1460. X*** 142,148
  1461. X      fprintf(outfile,"/gnulinewidth %.3f def\n",PS_LW);
  1462. X      fprintf(outfile,"/vshift %d def\n", 
  1463. X          ps_big ? -PS_VCHAR2/3 : -PS_VCHAR1/3);
  1464. X!     fprintf(outfile,"/dl {%.3f mul} def\n",1/PS_SC); /* dash length */
  1465. X      fprintf(outfile,"/hpt %.1f def\n",PS_HTIC/2.0);
  1466. X      fprintf(outfile,"/vpt %.1f def\n",PS_VTIC/2.0);
  1467. X      for ( i=0; PS_header[i] != NULL; i++)
  1468. X
  1469. X--- 145,151 -----
  1470. X      fprintf(outfile,"/gnulinewidth %.3f def\n",PS_LW);
  1471. X      fprintf(outfile,"/vshift %d def\n", 
  1472. X          ps_big ? -PS_VCHAR2/3 : -PS_VCHAR1/3);
  1473. X!     fprintf(outfile,"/dl {%d mul} def\n",PS_SC); /* dash length */
  1474. X      fprintf(outfile,"/hpt %.1f def\n",PS_HTIC/2.0);
  1475. X      fprintf(outfile,"/vpt %.1f def\n",PS_VTIC/2.0);
  1476. X      for ( i=0; PS_header[i] != NULL; i++)
  1477. X***************
  1478. X*** 150,156
  1479. X      fprintf(outfile,"%%%%EndProlog\n");
  1480. X      fprintf(outfile,"%%%%BeginSetup\n");
  1481. X      fprintf(outfile,"/Gnu_save save def\n");
  1482. X!     fprintf(outfile,"%.3f %.3f scale\n",PS_SC,PS_SC);
  1483. X      fprintf(outfile,"%%%%IncludeFont: %s\n", ps_font);
  1484. X      fprintf(outfile,"/%s findfont %d ", ps_font, 
  1485. X          ps_big ? PS_VCHAR2 : PS_VCHAR1 );
  1486. X
  1487. X--- 153,160 -----
  1488. X      fprintf(outfile,"%%%%EndProlog\n");
  1489. X      fprintf(outfile,"%%%%BeginSetup\n");
  1490. X      fprintf(outfile,"/Gnu_save save def\n");
  1491. X!     fprintf(outfile,"%.3f %.3f scale\n",1.0/PS_SC,1.0/PS_SC);
  1492. X!     fprintf(outfile,"0 setgray\n");
  1493. X      fprintf(outfile,"%%%%IncludeFont: %s\n", ps_font);
  1494. X      fprintf(outfile,"/%s findfont %d ", ps_font, 
  1495. X          ps_big ? PS_VCHAR2 : PS_VCHAR1 );
  1496. X***************
  1497. X*** 198,205
  1498. X      fprintf(outfile,"%%%%DocumentNeededFonts: %s\n", ps_font);
  1499. X      fprintf(outfile,"%%%%Pages: (atend)\n");
  1500. X      fprintf(outfile,"%%%%BoundingBox: %d 50 550 %d\n",
  1501. X!         (int)(550.5-ysize*(PS_YMAX)*PS_SC*2), 
  1502. X!         (int)(50.5+xsize*(PS_XMAX)*PS_SC*2) );
  1503. X      fprintf(outfile,"%%%%EndComments\n");
  1504. X      fprintf(outfile,"/GnuTransform {\n");
  1505. X      fprintf(outfile,"  90 rotate\n  50 -550 translate\n  2 2 scale\n");
  1506. X
  1507. X--- 202,209 -----
  1508. X      fprintf(outfile,"%%%%DocumentNeededFonts: %s\n", ps_font);
  1509. X      fprintf(outfile,"%%%%Pages: (atend)\n");
  1510. X      fprintf(outfile,"%%%%BoundingBox: %d 50 550 %d\n",
  1511. X!         (int)(550.5-ysize*(PS_YMAX)/PS_SC*2), 
  1512. X!         (int)(50.5+xsize*(PS_XMAX)/PS_SC*2) );
  1513. X      fprintf(outfile,"%%%%EndComments\n");
  1514. X      fprintf(outfile,"/GnuTransform {\n");
  1515. X      fprintf(outfile,"  90 rotate\n  50 -550 translate\n  2 2 scale\n");
  1516. X***************
  1517. X*** 292,297
  1518. X      }
  1519. X      if (ps_ang != 0)
  1520. X          fprintf(outfile,"grestore\n");
  1521. X  }
  1522. X  
  1523. X  int PS_text_angle(ang)
  1524. X
  1525. X--- 296,302 -----
  1526. X      }
  1527. X      if (ps_ang != 0)
  1528. X          fprintf(outfile,"grestore\n");
  1529. X+     ps_path_count = 0;
  1530. X  }
  1531. X  
  1532. X  int PS_text_angle(ang)
  1533. Xdiff -c ./term/t410x.trm ../patch/term/t410x.trm
  1534. X*** ./term/t410x.trm    Wed Aug 29 12:16:17 1990
  1535. X--- ../patch/term/t410x.trm    Tue Aug 28 20:28:50 1990
  1536. X***************
  1537. X*** 0
  1538. X
  1539. X--- 1,239 -----
  1540. X+ /* GNUPLOT - t410x.trm */
  1541. X+ /*
  1542. X+  * Copyright (C) 1990   
  1543. X+  *
  1544. X+  * Permission to use, copy, and distribute this software and its
  1545. X+  * documentation for any purpose with or without fee is hereby granted, 
  1546. X+  * provided that the above copyright notice appear in all copies and 
  1547. X+  * that both that copyright notice and this permission notice appear 
  1548. X+  * in supporting documentation.
  1549. X+  *
  1550. X+  * Permission to modify the software is granted, but not the right to
  1551. X+  * distribute the modified code.  Modifications are to be distributed 
  1552. X+  * as patches to released version.
  1553. X+  *  
  1554. X+  * This software  is provided "as is" without express or implied warranty.
  1555. X+  * 
  1556. X+  * This file is included by ../term.c.
  1557. X+  *
  1558. X+  * This terminal driver supports: Tektronix 410x and 420x series terminals
  1559. X+  *
  1560. X+  * AUTHORS
  1561. X+  *   Colin Kelley, Thomas Williams
  1562. X+  * 
  1563. X+  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1564. X+  * 
  1565. X+  */
  1566. X+ 
  1567. X+ /* Tektronix 410X and 420X driver written by Cary D. Renzema.
  1568. X+  * email address: caryr@vice.ico.tek.com
  1569. X+  *
  1570. X+  * I've tested this driver on the following terminals: 4106, 4107A, 4109
  1571. X+  * and 4207.  It should work, without editing, on other terminals in the
  1572. X+  * 410x and 420x families.  It will probably need to be changed to work
  1573. X+  * on a 4105 (screen size and character rotation are two guesses).  This
  1574. X+  * file can also be used as a start for a 411x driver.
  1575. X+  *
  1576. X+  * Cary R.
  1577. X+  * April 5, 1990
  1578. X+  */
  1579. X+ 
  1580. X+ #ifdef T410X
  1581. X+ 
  1582. X+ #define T410XXMAX 4095
  1583. X+ #define T410XYMAX 3131
  1584. X+ 
  1585. X+ #define T410XVCHAR    71
  1586. X+ #define T410XHCHAR    51
  1587. X+ #define T410XVTIC    36
  1588. X+ #define T410XHTIC    36    
  1589. X+ 
  1590. X+ static int T410X_angle=0;
  1591. X+ 
  1592. X+ T410X_init()
  1593. X+ {
  1594. X+     (void) fprintf(outfile, "\033%%!0\033MN0\033MCB7C;\033MQ1\033MT1");
  1595. X+     (void) fprintf(outfile, "\033MG1\033RK!\033SK!\033LZ\033%%!1");
  1596. X+ /*
  1597. X+      1. set tek mode
  1598. X+      2. set character path to 0 (characters placed equal to rotation)
  1599. X+      3. set character size to 59 height
  1600. X+      4. set character precision to string
  1601. X+      5. set character text index to 1
  1602. X+      6. set character write mode to overstrike
  1603. X+      7. clear the view
  1604. X+      8. clear the segments
  1605. X+      9. clear the dialog buffer
  1606. X+     10. set ansi mode
  1607. X+ */
  1608. X+     (void) fflush(outfile);
  1609. X+ }
  1610. X+ 
  1611. X+ 
  1612. X+ T410X_reset()
  1613. X+ {
  1614. X+     (void) fprintf(outfile, "\033%%!0\033LZ\033%%!1");
  1615. X+ /*
  1616. X+     1. set tek mode
  1617. X+     2. clear the dialog buffer
  1618. X+     3. set ansi mode
  1619. X+ */
  1620. X+     (void) fflush(outfile);
  1621. X+ }
  1622. X+ 
  1623. X+ 
  1624. X+ T410X_graphics()
  1625. X+ {
  1626. X+     (void) fprintf(outfile, "\033%%!0\033\014\033LV0");
  1627. X+ /*
  1628. X+     1. set tek mode
  1629. X+     2. clear the screen
  1630. X+     3. set dialog area invisible
  1631. X+ */
  1632. X+     (void) fflush(outfile);
  1633. X+ }
  1634. X+ 
  1635. X+ T410X_text()
  1636. X+ {
  1637. X+     (void) fprintf(outfile, "\033LV1\033%%!1");
  1638. X+ /*
  1639. X+     1. set dialog area visible
  1640. X+     2. set ansi mode
  1641. X+ */
  1642. X+     (void) fflush(outfile);
  1643. X+ }
  1644. X+ 
  1645. X+ 
  1646. X+ T410X_move(x, y)
  1647. X+ unsigned int x, y;
  1648. X+ {
  1649. X+     (void) fprintf(outfile, "\033LF");
  1650. X+     (void) T410X_encode_x_y(x, y);
  1651. X+     (void) fflush(outfile);
  1652. X+ }
  1653. X+ 
  1654. X+ 
  1655. X+ T410X_vector(x, y)
  1656. X+ unsigned int x, y;
  1657. X+ {
  1658. X+     (void) fprintf(outfile, "\033LG");
  1659. X+     (void) T410X_encode_x_y(x, y);
  1660. X+     (void) fflush(outfile);
  1661. X+ }
  1662. X+ 
  1663. X+ 
  1664. X+ T410X_point(x, y, number)
  1665. X+ unsigned int x, y;
  1666. X+ int number;
  1667. X+ {
  1668. X+     (void) fprintf(outfile, "\033MM");
  1669. X+     (void) T410X_encode_int(max(number, 0)%11);
  1670. X+     (void) fprintf(outfile, "\033LH");
  1671. X+     (void) T410X_encode_x_y(x, y);
  1672. X+     (void) fflush(outfile);
  1673. X+ }
  1674. X+ 
  1675. X+ 
  1676. X+ T410X_linetype(linetype)
  1677. X+ int linetype;
  1678. X+ {
  1679. X+     switch (linetype) {
  1680. X+         case -1:
  1681. X+             (void) fprintf(outfile, "\033ML5");
  1682. X+             break;
  1683. X+         case -2:
  1684. X+             (void) fprintf(outfile, "\033ML?");
  1685. X+             break;
  1686. X+         default:
  1687. X+             (void) fprintf(outfile, "\033ML");
  1688. X+             (void) T410X_encode_int(linetype%14+2);
  1689. X+             break;
  1690. X+     }
  1691. X+     (void) fprintf(outfile, "\033MV");
  1692. X+     (void) T410X_encode_int(max(linetype, 0)%8);
  1693. X+     (void) fflush(outfile);
  1694. X+ }
  1695. X+ 
  1696. X+ 
  1697. X+ T410X_put_text(x, y, str)
  1698. X+ unsigned int x, y;
  1699. X+ char str[];
  1700. X+ {
  1701. X+     extern int T410X_angle;
  1702. X+ 
  1703. X+     if (T410X_angle == 0) {
  1704. X+         (void) T410X_move(x, y-T410XVCHAR/2+6);
  1705. X+         (void) fprintf(outfile, "\033MR00");
  1706. X+     } else {
  1707. X+         (void) T410X_move(x+T410XHCHAR/2-6, y);
  1708. X+         (void) fprintf(outfile, "\033MRE:0");
  1709. X+     }
  1710. X+     (void) fprintf(outfile, "\033LT");
  1711. X+     (void) T410X_encode_int(strlen(str));
  1712. X+     (void) fputs(str, outfile);
  1713. X+     (void) fflush(outfile);
  1714. X+ }
  1715. X+ 
  1716. X+ T410X_text_angle(ang)
  1717. X+ int ang;
  1718. X+ {
  1719. X+     extern int T410X_angle;
  1720. X+ 
  1721. X+     T410X_angle = ang;
  1722. X+     return(TRUE);
  1723. X+ }
  1724. X+ 
  1725. X+ /* These last two routines are based on fortran code found in the
  1726. X+  * 4106/4107/4109/CX PROGRAMMERS manual.
  1727. X+  */
  1728. X+ 
  1729. X+ T410X_encode_x_y(x, y)
  1730. X+ unsigned int x, y;
  1731. X+ {
  1732. X+     static char chix=0, chiy=0, cloy=0, ceb=0;
  1733. X+ 
  1734. X+     register unsigned int hix, lox, hiy, loy, eb, lx, ly;
  1735. X+ 
  1736. X+     lx = (x <= T410XXMAX) ? x : T410XXMAX;
  1737. X+     ly = (y <= T410XYMAX) ? y : T410XYMAX;
  1738. X+ 
  1739. X+     hix = lx/128 + 32;
  1740. X+     lox = (lx/4)%32 + 64;
  1741. X+     hiy = ly/128 + 32;
  1742. X+     loy = (ly/4)%32 + 96;
  1743. X+     eb = (ly%4)*4 + lx%4 + 96;
  1744. X+ 
  1745. X+     if (chiy != hiy) (void) putc(hiy, outfile);
  1746. X+     if (ceb != eb) (void) putc(eb, outfile);
  1747. X+     if ((cloy!=loy) || (ceb!=eb) || (chix!=hix)) (void) putc(loy, outfile);
  1748. X+     if (chix != hix) (void) putc(hix, outfile);
  1749. X+     (void) putc(lox, outfile);
  1750. X+ 
  1751. X+     chix = hix;
  1752. X+     chiy = hiy;
  1753. X+     cloy = loy;
  1754. X+     ceb = eb;
  1755. X+ }
  1756. X+ 
  1757. X+ 
  1758. X+ T410X_encode_int(number)
  1759. X+ int number;
  1760. X+ {
  1761. X+     register unsigned int mag, hi1, hi2, lo;
  1762. X+ 
  1763. X+     mag = abs(number);
  1764. X+ 
  1765. X+     hi1 = mag/1024 + 64;
  1766. X+     hi2 = (mag/16)%64 + 64;
  1767. X+     lo = mag%16 + 32;
  1768. X+ 
  1769. X+     if (number >= 0) lo += 16;
  1770. X+ 
  1771. X+     if (hi1 != 64) (void) putc(hi1, outfile);
  1772. X+     if ((hi2 != 64) || (hi1 != 64)) (void) putc(hi2, outfile);
  1773. X+     (void) putc(lo, outfile);
  1774. X+ 
  1775. X+ }
  1776. X+ 
  1777. X+ 
  1778. X+ #endif /* T410X */
  1779. Xdiff -c ./term/unixpc.trm ../patch/term/unixpc.trm
  1780. X*** ./term/unixpc.trm    Tue Mar 27 09:03:15 1990
  1781. X--- ../patch/term/unixpc.trm    Tue Aug 28 16:03:19 1990
  1782. X***************
  1783. X*** 122,128
  1784. X     uw.uw_height = uPC_YMAX;     /* 288 normal--we clobber 12 (top row)*/
  1785. X     uw.uw_uflags = 1;         /* Creates with no border */
  1786. X  
  1787. X!    IfErrOut (ioctl(0, WIOCSETD, &uw), <0, "ioctl failed on", "WIOCSETD");
  1788. X  }
  1789. X  
  1790. X  
  1791. X
  1792. X--- 122,128 -----
  1793. X     uw.uw_height = uPC_YMAX;     /* 288 normal--we clobber 12 (top row)*/
  1794. X     uw.uw_uflags = 1;         /* Creates with no border */
  1795. X  
  1796. X!    IfErrOut (ioctl(1, WIOCSETD, &uw), <0, "ioctl failed on", "WIOCSETD");
  1797. X  }
  1798. X  
  1799. X  
  1800. X***************
  1801. X*** 144,150
  1802. X     printf ("\033[25;1H");
  1803. X  
  1804. X     uPC_ur.ur_dstop = DSTSRC;   /* replace (clear screen). */
  1805. X!    IfErrOut (ioctl(0, WIOCRASTOP, &uPC_ur), <0,
  1806. X        "ioctl failed", "WIOCRASTOP");
  1807. X     uPC_ur.ur_dstop = DSTOR;   /* Or in (show text) */
  1808. X  }
  1809. X
  1810. X--- 144,150 -----
  1811. X     printf ("\033[25;1H");
  1812. X  
  1813. X     uPC_ur.ur_dstop = DSTSRC;   /* replace (clear screen). */
  1814. X!    IfErrOut (ioctl(1, WIOCRASTOP, &uPC_ur), <0,
  1815. X        "ioctl failed", "WIOCRASTOP");
  1816. X     uPC_ur.ur_dstop = DSTOR;   /* Or in (show text) */
  1817. X  }
  1818. X***************
  1819. X*** 154,160
  1820. X  {
  1821. X  /* This routine will flush the display. */
  1822. X  
  1823. X!    IfErrOut (ioctl(0, WIOCRASTOP, &uPC_ur), <0,
  1824. X        "ioctl failed", "WIOCRASTOP");
  1825. X  }
  1826. X  
  1827. X
  1828. X--- 154,160 -----
  1829. X  {
  1830. X  /* This routine will flush the display. */
  1831. X  
  1832. X!    IfErrOut (ioctl(1, WIOCRASTOP, &uPC_ur), <0,
  1833. X        "ioctl failed", "WIOCRASTOP");
  1834. X  }
  1835. X  
  1836. X***************
  1837. X*** 522,528
  1838. X     struct utdata ut;
  1839. X  
  1840. X  /* Reset the window to the right size. */
  1841. X!    ioctl(0, WIOCSETD, &wreset);   /* 0, not wncur here! */
  1842. X  
  1843. X  /* Scroll the screen once. (avoids typing over the same line) */
  1844. X     fprintf (stderr, "\n");
  1845. X
  1846. X--- 522,528 -----
  1847. X     struct utdata ut;
  1848. X  
  1849. X  /* Reset the window to the right size. */
  1850. X!    ioctl(1, WIOCSETD, &wreset);   /* 0, not wncur here! */
  1851. X  
  1852. X  /* Scroll the screen once. (avoids typing over the same line) */
  1853. X     fprintf (stderr, "\n");
  1854. Xdiff -c ./term/x11.trm ../patch/term/x11.trm
  1855. X*** ./term/x11.trm    Thu Sep  6 09:24:44 1990
  1856. X--- ../patch/term/x11.trm    Tue Sep  4 00:50:32 1990
  1857. X***************
  1858. X*** 0
  1859. X
  1860. X--- 1,77 -----
  1861. X+ /*
  1862. X+  *    x11.trm  --- inboard terminal driver for X11
  1863. X+  */
  1864. X+ 
  1865. X+ #define X11_XMAX 4096
  1866. X+ #define X11_YMAX 4096
  1867. X+ 
  1868. X+ /* approximations for typical font/screen sizes */
  1869. X+ #define X11_VCHAR (X11_YMAX/25) 
  1870. X+ #define X11_HCHAR (X11_XMAX/100) 
  1871. X+ #define X11_VTIC (X11_YMAX/100)
  1872. X+ #define X11_HTIC (X11_XMAX/150)
  1873. X+ 
  1874. X+ #define X11_nopts 22
  1875. X+ char X11_opts[X11_nopts][20] = {
  1876. X+    "-iconic", "-rv", "-reverse", "+rv", "-synchronous", 
  1877. X+    "-display", "-geometry", "-bg", "-background", "-bd", "-bordercolor", "-bw",
  1878. X+    "-borderwidth", "-fg", "-foreground", "-fn", "-font", "-name", 
  1879. X+    "-selectionTimeout", "-title", "-xnllanguage", "-xrm" 
  1880. X+    };
  1881. X+ int X11_optarg[X11_nopts] = { 
  1882. X+    0, 0, 0, 0, 0,
  1883. X+    1, 1, 1, 1, 1, 1, 1,
  1884. X+    1, 1, 1, 1, 1, 1, 
  1885. X+    1, 1, 1, 1
  1886. X+    };
  1887. X+ 
  1888. X+ FILE *X11_pipe, *popen();
  1889. X+ char X11_command[1024]= "gnuplot_x11 -name gnuplot";
  1890. X+ 
  1891. X+ 
  1892. X+ /*   X11_args - scan gnuplot command line for standard X Toolkit options */
  1893. X+ 
  1894. X+ X11_args(argc, argv) int argc; char *argv[]; {
  1895. X+    int nx11 = 0, n;
  1896. X+ 
  1897. X+    while(++argv, --argc > 0) {
  1898. X+       for (n=0; n<X11_nopts; n++) {
  1899. X+      if (!strcmp(*argv, X11_opts[n])) {
  1900. X+         strcat(X11_command, " ");
  1901. X+         strcat(X11_command, *argv); 
  1902. X+         if (X11_optarg[n]) {
  1903. X+            if (--argc <= 0) return(nx11);
  1904. X+            strcat(X11_command, " \"");
  1905. X+            strcat(X11_command, *++argv); 
  1906. X+            strcat(X11_command, "\"");
  1907. X+            nx11++;
  1908. X+            }
  1909. X+         nx11++; break;
  1910. X+         }
  1911. X+      }
  1912. X+       if (n == X11_nopts) break; 
  1913. X+       }
  1914. X+    return(nx11);
  1915. X+    }
  1916. X+ 
  1917. X+ X11_init() { X11_pipe = popen(X11_command, "w"); }
  1918. X+ 
  1919. X+ X11_reset() { fprintf(X11_pipe, "R\n"); fflush(X11_pipe); }
  1920. X+ 
  1921. X+ X11_text() { fprintf(X11_pipe, "E\n"); fflush(X11_pipe); }
  1922. X+ 
  1923. X+ X11_graphics() { fprintf(X11_pipe, "G\n"); }
  1924. X+ 
  1925. X+ X11_move(x,y) unsigned int x,y; { fprintf(X11_pipe, "M%04d%04d\n", x, y); }
  1926. X+ 
  1927. X+ X11_vector(x,y) unsigned int x,y; { fprintf(X11_pipe, "V%04d%04d\n", x, y); }
  1928. X+ 
  1929. X+ X11_linetype(lt) int lt; { fprintf(X11_pipe, "L%04d\n", lt); }
  1930. X+ 
  1931. X+ X11_put_text(x,y,str) unsigned int x,y; char str[]; {
  1932. X+    fprintf(X11_pipe, "T%04d%04d%s\n", x, y, str);
  1933. X+    }
  1934. X+ X11_justify_text(mode) enum JUSTIFY mode; {
  1935. X+    fprintf(X11_pipe, "J%04d\n", mode);
  1936. X+    return(TRUE);
  1937. X+    }
  1938. X*** ./term.h    Wed Aug 29 12:15:55 1990
  1939. X--- ../patch1/term.h    Tue Sep 18 14:40:02 1990
  1940. X***************
  1941. X*** 0
  1942. X
  1943. X--- 1,86 -----
  1944. X+ /* GNUPLOT - term.h */
  1945. X+ /*
  1946. X+  * Copyright (C) 1986, 1987, 1990   Thomas Williams, Colin Kelley
  1947. X+  *
  1948. X+  * Permission to use, copy, and distribute this software and its
  1949. X+  * documentation for any purpose with or without fee is hereby granted, 
  1950. X+  * provided that the above copyright notice appear in all copies and 
  1951. X+  * that both that copyright notice and this permission notice appear 
  1952. X+  * in supporting documentation.
  1953. X+  *
  1954. X+  * Permission to modify the software is granted, but not the right to
  1955. X+  * distribute the modified code.  Modifications are to be distributed 
  1956. X+  * as patches to released version.
  1957. X+  *  
  1958. X+  * This software  is provided "as is" without express or implied warranty.
  1959. X+  * 
  1960. X+  *
  1961. X+  * AUTHORS
  1962. X+  * 
  1963. X+  *   Original Software:
  1964. X+  *     Thomas Williams,  Colin Kelley.
  1965. X+  * 
  1966. X+  *   Gnuplot 2.0 additions:
  1967. X+  *       Russell Lang, Dave Kotz, John Campbell.
  1968. X+  * 
  1969. X+  * send your comments or suggestions to (pixar!info-gnuplot@sun.com).
  1970. X+  * 
  1971. X+  **************************************
  1972. X+  * term.h: terminal support definitions
  1973. X+  *   Edit this file depending on the set of terminals you wish to support.
  1974. X+  * Comment out the terminal types that you don't want or don't have, and
  1975. X+  * uncomment those that you want included. Be aware that some terminal 
  1976. X+  * types (eg, SUN, UNIXPLOT) will require changes in the makefile 
  1977. X+  * LIBS definition. 
  1978. X+  */
  1979. X+ 
  1980. X+ /* These terminals are not relevant for MSDOS */
  1981. X+ #ifndef MSDOS
  1982. X+ 
  1983. X+ #define AED         /* AED 512 and AED 767 */
  1984. X+ #define BITGRAPH    /* BBN BitGraph */
  1985. X+ #define HPLJET        /* HP Laserjet */
  1986. X+ /* #define IRIS4D      /* IRIS4D series computer */
  1987. X+ #define KERMIT      /* MS-Kermit Tektronix 4010 emulator */
  1988. X+ /* #define FIG           /* Fig graphics language (requires object.h from TransFig) */
  1989. X+ #define REGIS       /* ReGis graphics (vt125, vt220, vt240, Gigis...) */
  1990. X+ #define SELANAR     /* Selanar */
  1991. X+ /* #define SUN         /* Sun Microsystems Workstation */
  1992. X+ #define T410X       /* Tektronix 4106, 4107, 4109 and 420x terminals */
  1993. X+ #define TEK         /* Tektronix 4010, and probably others */
  1994. X+ /* #define UNIXPC      /* unixpc (ATT 3b1 or ATT 7300) */
  1995. X+ /* #define UNIXPLOT    /* unixplot */
  1996. X+ /* #define X11         /* X11R4 window system */
  1997. X+ 
  1998. X+ #endif 
  1999. X+ 
  2000. X+ /* These terminals can be used on any system */
  2001. X+ #define DXY800A        /* Roland DXY800A plotter */
  2002. X+ #define EEPIC        /* EEPIC-extended LaTeX driver, for EEPIC users */
  2003. X+ #define EMTEX        /* LATEX picture environment with EMTEX specials */
  2004. X+ #define EPS60        /* Epson-style 60-dot per inch printers */
  2005. X+ #define EPSON        /* Epson LX-800, Star NL-10, NX-1000 and lots of others */
  2006. X+ #define HP2648        /* HP2648, HP2647 */
  2007. X+ #define HP26        /* HP2623A and maybe others */
  2008. X+ #define HP75        /* HP7580, and probably other HPs */
  2009. X+ #define HPGL        /* HP7475, HP7220 plotters, and (hopefully) lots of others */
  2010. X+ #define IMAGEN      /* Imagen laser printers (300dpi) (requires -Iterm also) */
  2011. X+ #define LATEX       /* LATEX picture environment */
  2012. X+ #define NEC         /* NEC CP6 pinwriter printer */
  2013. X+ #define POSTSCRIPT  /* Postscript */
  2014. X+ #define PROPRINTER  /* IBM Proprinter */
  2015. X+ #define QMS         /* QMS/QUIC laserprinter (Talaris 1200 and others) */
  2016. X+ #define STARC       /* Star Color Printer */
  2017. X+ #define TANDY60        /* Tandy DMP-130 series 60-dot per inch graphics */
  2018. X+ #define V384        /* Vectrix 384 and tandy color printer */
  2019. X+ 
  2020. X+ /* These are for MSDOS only */
  2021. X+ #ifdef MSDOS
  2022. X+ #ifdef __TURBOC__
  2023. X+ #define ATT6300        /* AT&T 6300 graphics */
  2024. X+ #else
  2025. X+ #define ATT6300        /* AT&T 6300 graphics */
  2026. X+ #define CORONA      /* Corona graphics 325 */
  2027. X+ #define HERCULES    /* IBM PC/Clone with Hercules graphics board */
  2028. X+ #endif
  2029. X+ #endif
  2030. X*** ./term.c    Tue Mar 27 09:02:05 1990
  2031. X--- ../patch1/term.c    Thu Sep  6 09:20:17 1990
  2032. X***************
  2033. X*** 29,34
  2034. X  
  2035. X  #include <stdio.h>
  2036. X  #include "plot.h"
  2037. X  
  2038. X  /* for use by all drivers */
  2039. X  #define sign(x) ((x) >= 0 ? 1 : -1)
  2040. X
  2041. X--- 29,35 -----
  2042. X  
  2043. X  #include <stdio.h>
  2044. X  #include "plot.h"
  2045. X+ #include "term.h"
  2046. X  
  2047. X  /* for use by all drivers */
  2048. X  #define sign(x) ((x) >= 0 ? 1 : -1)
  2049. X***************
  2050. X*** 242,247
  2051. X  #endif
  2052. X  #endif
  2053. X  
  2054. X  #ifdef EPSON
  2055. X  #define FONT57
  2056. X  #endif
  2057. X
  2058. X--- 243,266 -----
  2059. X  #endif
  2060. X  #endif
  2061. X  
  2062. X+ #ifdef STARC 
  2063. X+ #ifndef EPSON
  2064. X+ #define EPSON 
  2065. X+ #endif
  2066. X+ #endif
  2067. X+ 
  2068. X+ #ifdef TANDY60
  2069. X+ #ifndef EPS60
  2070. X+ #define EPS60
  2071. X+ #endif
  2072. X+ #endif
  2073. X+ 
  2074. X+ #ifdef EPS60
  2075. X+ #ifndef EPSON
  2076. X+ #define EPSON
  2077. X+ #endif
  2078. X+ #endif
  2079. X+ 
  2080. X  #ifdef EPSON
  2081. X  #define FONT57
  2082. X  #endif
  2083. X***************
  2084. X*** 282,287
  2085. X  # endif
  2086. X  #endif
  2087. X  
  2088. X  #ifdef TEK            /* all TEK types, TEK, BBN, SELANAR, KERMIT */
  2089. X  #include "term/tek.trm"
  2090. X  #endif
  2091. X
  2092. X--- 301,310 -----
  2093. X  # endif
  2094. X  #endif
  2095. X  
  2096. X+ #ifdef T410X        /* Tektronix 4106, 4107, 4109 and 420x terminals */
  2097. X+ #include "term/t410x.trm"
  2098. X+ #endif
  2099. X+ 
  2100. X  #ifdef TEK            /* all TEK types, TEK, BBN, SELANAR, KERMIT */
  2101. X  #include "term/tek.trm"
  2102. X  #endif
  2103. X***************
  2104. X*** 286,292
  2105. X  #include "term/tek.trm"
  2106. X  #endif
  2107. X  
  2108. X! #ifdef EPSON        /* all bit map types, EPSON, NEC, PROPRINTER */
  2109. X  #include "term/epson.trm"
  2110. X  #endif
  2111. X  
  2112. X
  2113. X--- 309,315 -----
  2114. X  #include "term/tek.trm"
  2115. X  #endif
  2116. X  
  2117. X! #ifdef EPSON    /* bit map types, EPSON, NEC, PROPRINTER, STAR Color */
  2118. X  #include "term/epson.trm"
  2119. X  #endif
  2120. X  
  2121. X***************
  2122. X*** 290,295
  2123. X  #include "term/epson.trm"
  2124. X  #endif
  2125. X  
  2126. X  #ifdef FIG                /* Fig 1.4FS Interactive graphics program */
  2127. X  #include "term/fig.trm"
  2128. X  #endif
  2129. X
  2130. X--- 313,322 -----
  2131. X  #include "term/epson.trm"
  2132. X  #endif
  2133. X  
  2134. X+ #ifdef EPS60        /* old-style EPSON 60-dpi */
  2135. X+ #include "term/eps60.trm"
  2136. X+ #endif
  2137. X+ 
  2138. X  #ifdef FIG                /* Fig 1.4FS Interactive graphics program */
  2139. X  #include "term/fig.trm"
  2140. X  #endif
  2141. X***************
  2142. X*** 305,310
  2143. X  # endif
  2144. X  #endif
  2145. X  
  2146. X  #ifdef LATEX        /* LATEX type */
  2147. X  #include "term/latex.trm"
  2148. X  #endif
  2149. X
  2150. X--- 332,343 -----
  2151. X  # endif
  2152. X  #endif
  2153. X  
  2154. X+ #ifdef EMTEX        /* EMTEX (LATEX for PC) type */
  2155. X+ # ifndef LATEX
  2156. X+ #  define LATEX
  2157. X+ # endif
  2158. X+ #endif
  2159. X+ 
  2160. X  #ifdef LATEX        /* LATEX type */
  2161. X  #include "term/latex.trm"
  2162. X  #endif
  2163. X***************
  2164. X*** 375,380
  2165. X  #include "term/unixplot.trm"
  2166. X  #endif /* UNIXPLOT */
  2167. X  
  2168. X  /* Dummy functions for unavailable features */
  2169. X  
  2170. X  /* change angle of text.  0 is horizontal left to right.
  2171. X
  2172. X--- 408,417 -----
  2173. X  #include "term/unixplot.trm"
  2174. X  #endif /* UNIXPLOT */
  2175. X  
  2176. X+ #ifdef X11
  2177. X+ #include "term/x11.trm"
  2178. X+ #endif /* X11 */
  2179. X+ 
  2180. X  /* Dummy functions for unavailable features */
  2181. X  
  2182. X  /* change angle of text.  0 is horizontal left to right.
  2183. X***************
  2184. X*** 464,469
  2185. X         HERC_text, null_scale, HERC_graphics, HERC_move, HERC_vector,
  2186. X         HERC_linetype, HERC_put_text, MCGA_text_angle, 
  2187. X         HERC_justify_text, line_and_point, do_arrow}
  2188. X  #else                    /* TURBO */
  2189. X  
  2190. X      ,{"cga", "IBM PC/Clone with CGA graphics board",
  2191. X
  2192. X--- 501,514 -----
  2193. X         HERC_text, null_scale, HERC_graphics, HERC_move, HERC_vector,
  2194. X         HERC_linetype, HERC_put_text, MCGA_text_angle, 
  2195. X         HERC_justify_text, line_and_point, do_arrow}
  2196. X+ #ifdef ATT6300
  2197. X+     ,{"att", "IBM PC/Clone with AT&T 6300 graphics board",
  2198. X+        ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
  2199. X+        ATT_VTIC, ATT_HTIC, ATT_init, ATT_reset,
  2200. X+        ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
  2201. X+        ATT_linetype, ATT_put_text, ATT_text_angle, 
  2202. X+        ATT_justify_text, line_and_point, do_arrow}
  2203. X+ #endif
  2204. X  #else                    /* TURBO */
  2205. X  
  2206. X      ,{"cga", "IBM PC/Clone with CGA graphics board",
  2207. X***************
  2208. X*** 506,512
  2209. X  #endif                    /* HERCULES */
  2210. X  
  2211. X  #ifdef ATT6300
  2212. X!     ,{"att", "AT&T 6300 terminal ???",
  2213. X         ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
  2214. X         ATT_VTIC, ATT_HTIC, ATT_init, ATT_reset,
  2215. X         ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
  2216. X
  2217. X--- 551,557 -----
  2218. X  #endif                    /* HERCULES */
  2219. X  
  2220. X  #ifdef ATT6300
  2221. X!     ,{"att", "AT&T PC/6300 graphics",
  2222. X         ATT_XMAX, ATT_YMAX, ATT_VCHAR, ATT_HCHAR,
  2223. X         ATT_VTIC, ATT_HTIC, ATT_init, ATT_reset,
  2224. X         ATT_text, null_scale, ATT_graphics, ATT_move, ATT_vector,
  2225. X***************
  2226. X*** 558,563
  2227. X         null_justify_text, do_point, do_arrow}
  2228. X  #endif
  2229. X  
  2230. X  #ifdef EPSON
  2231. X      ,{"epson_lx800", "Epson LX-800, Star NL-10, NX-1000 and lots of others",
  2232. X         EPSONXMAX, EPSONYMAX, EPSONVCHAR, EPSONHCHAR, 
  2233. X
  2234. X--- 603,636 -----
  2235. X         null_justify_text, do_point, do_arrow}
  2236. X  #endif
  2237. X  
  2238. X+ #ifdef EEPIC
  2239. X+     ,{"eepic", "EEPIC -- extended LaTeX picture environment",
  2240. X+        EEPIC_XMAX, EEPIC_YMAX, EEPIC_VCHAR, EEPIC_HCHAR, 
  2241. X+        EEPIC_VTIC, EEPIC_HTIC, EEPIC_init, EEPIC_reset, 
  2242. X+        EEPIC_text, EEPIC_scale, EEPIC_graphics, EEPIC_move, EEPIC_vector, 
  2243. X+        EEPIC_linetype, EEPIC_put_text, EEPIC_text_angle, 
  2244. X+        EEPIC_justify_text, EEPIC_point, EEPIC_arrow}
  2245. X+ #endif
  2246. X+ 
  2247. X+ #ifdef EMTEX
  2248. X+    
  2249. X+     ,{"emtex", "LATEX picture environment with emTeX specials",
  2250. X+        LATEX_XMAX, LATEX_YMAX, LATEX_VCHAR, LATEX_HCHAR, 
  2251. X+        LATEX_VTIC, LATEX_HTIC, EMTEX_init, EMTEX_reset, 
  2252. X+        EMTEX_text, LATEX_scale, LATEX_graphics, LATEX_move, LATEX_vector, 
  2253. X+        LATEX_linetype, LATEX_put_text, LATEX_text_angle, 
  2254. X+        LATEX_justify_text, LATEX_point, LATEX_arrow}
  2255. X+ #endif
  2256. X+ 
  2257. X+ #ifdef EPS60
  2258. X+     ,{"epson_60dpi", "Epson-style 60-dot per inch printers",
  2259. X+        EPS60XMAX, EPS60YMAX, EPSONVCHAR, EPSONHCHAR,
  2260. X+        EPSONVTIC, EPSONHTIC, EPS60init, EPSONreset,
  2261. X+        EPS60text, null_scale, EPSONgraphics, EPSONmove, EPSONvector,
  2262. X+        EPSONlinetype, EPSONput_text, EPSON_text_angle,
  2263. X+        null_justify_text, do_point, do_arrow}
  2264. X+ #endif
  2265. X+ 
  2266. X  #ifdef EPSON
  2267. X      ,{"epson_lx800", "Epson LX-800, Star NL-10, NX-1000 and lots of others",
  2268. X         EPSONXMAX, EPSONYMAX, EPSONVCHAR, EPSONHCHAR, 
  2269. X***************
  2270. X*** 675,689
  2271. X         LATEX_justify_text, LATEX_point, LATEX_arrow}
  2272. X  #endif
  2273. X  
  2274. X- #ifdef EEPIC
  2275. X-     ,{"eepic", "EEPIC -- extended LaTeX picture environment",
  2276. X-        EEPIC_XMAX, EEPIC_YMAX, EEPIC_VCHAR, EEPIC_HCHAR, 
  2277. X-        EEPIC_VTIC, EEPIC_HTIC, EEPIC_init, EEPIC_reset, 
  2278. X-        EEPIC_text, EEPIC_scale, EEPIC_graphics, EEPIC_move, EEPIC_vector, 
  2279. X-        EEPIC_linetype, EEPIC_put_text, EEPIC_text_angle, 
  2280. X-        EEPIC_justify_text, EEPIC_point, EEPIC_arrow}
  2281. X- #endif
  2282. X- 
  2283. X  #ifdef NEC
  2284. X      ,{"nec_cp6m", "NEC printer CP6 Monochrome",
  2285. X         NECXMAX, NECYMAX, NECVCHAR, NECHCHAR, 
  2286. X
  2287. X--- 748,753 -----
  2288. X         LATEX_justify_text, LATEX_point, LATEX_arrow}
  2289. X  #endif
  2290. X  
  2291. X  #ifdef NEC
  2292. X      ,{"nec_cp6m", "NEC printer CP6 Monochrome",
  2293. X         NECXMAX, NECYMAX, NECVCHAR, NECHCHAR, 
  2294. X***************
  2295. X*** 769,774
  2296. X         null_justify_text, line_and_point, do_arrow}
  2297. X  #endif
  2298. X  
  2299. X  #ifdef SUN
  2300. X      ,{"sun", "SunView window system",
  2301. X         SUN_XMAX, SUN_YMAX, SUN_VCHAR, SUN_HCHAR, 
  2302. X
  2303. X--- 833,847 -----
  2304. X         null_justify_text, line_and_point, do_arrow}
  2305. X  #endif
  2306. X  
  2307. X+ #ifdef STARC
  2308. X+     ,{"starc", "Star Color Printer",
  2309. X+        STARCXMAX, STARCYMAX, STARCVCHAR, STARCHCHAR, 
  2310. X+        STARCVTIC, STARCHTIC, STARCinit, STARCreset, 
  2311. X+        STARCtext, null_scale, STARCgraphics, STARCmove, STARCvector, 
  2312. X+        STARClinetype, STARCput_text, STARC_text_angle, 
  2313. X+        null_justify_text, line_and_point, do_arrow}
  2314. X+ #endif
  2315. X+ 
  2316. X  #ifdef SUN
  2317. X      ,{"sun", "SunView window system",
  2318. X         SUN_XMAX, SUN_YMAX, SUN_VCHAR, SUN_HCHAR, 
  2319. X***************
  2320. X*** 778,783
  2321. X         SUN_justify_text, line_and_point, do_arrow}
  2322. X  #endif
  2323. X  
  2324. X  #ifdef TEK
  2325. X      ,{"tek40xx", "Tektronix 4010 and others; most TEK emulators",
  2326. X         TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR, 
  2327. X
  2328. X--- 851,874 -----
  2329. X         SUN_justify_text, line_and_point, do_arrow}
  2330. X  #endif
  2331. X  
  2332. X+ #ifdef TANDY60
  2333. X+     ,{"tandy_60dpi", "Tandy DMP-130 series 60-dot per inch graphics",
  2334. X+        EPS60XMAX, EPS60YMAX, EPSONVCHAR, EPSONHCHAR,
  2335. X+        EPSONVTIC, EPSONHTIC, EPS60init, EPSONreset,
  2336. X+        TANDY60text, null_scale, EPSONgraphics, EPSONmove, EPSONvector,
  2337. X+        EPSONlinetype, EPSONput_text, EPSON_text_angle,
  2338. X+        null_justify_text, do_point, do_arrow}
  2339. X+ #endif
  2340. X+ 
  2341. X+ #ifdef T410X
  2342. X+     ,{"tek410x", "Tektronix 4106, 4107, 4109 and 420X terminals",
  2343. X+        T410XXMAX, T410XYMAX, T410XVCHAR, T410XHCHAR, 
  2344. X+        T410XVTIC, T410XHTIC, T410X_init, T410X_reset, 
  2345. X+        T410X_text, null_scale, T410X_graphics, T410X_move, T410X_vector, 
  2346. X+        T410X_linetype, T410X_put_text, T410X_text_angle, 
  2347. X+        null_justify_text, T410X_point, do_arrow}
  2348. X+ #endif
  2349. X+ 
  2350. X  #ifdef TEK
  2351. X      ,{"tek40xx", "Tektronix 4010 and others; most TEK emulators",
  2352. X         TEK40XMAX, TEK40YMAX, TEK40VCHAR, TEK40HCHAR, 
  2353. X***************
  2354. X*** 813,818
  2355. X         V384_linetype, V384_put_text, null_text_angle, 
  2356. X         null_justify_text, do_point, do_arrow}
  2357. X  #endif
  2358. X  };
  2359. X  
  2360. X  #define TERMCOUNT (sizeof(term_tbl)/sizeof(struct termentry))
  2361. X
  2362. X--- 904,924 -----
  2363. X         V384_linetype, V384_put_text, null_text_angle, 
  2364. X         null_justify_text, do_point, do_arrow}
  2365. X  #endif
  2366. X+ 
  2367. X+ #ifdef X11
  2368. X+     ,{"x11", "X11 Window System",
  2369. X+        X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR, 
  2370. X+        X11_VTIC, X11_HTIC, X11_init, X11_reset, 
  2371. X+        X11_text, null_scale, X11_graphics, X11_move, X11_vector, 
  2372. X+        X11_linetype, X11_put_text, null_text_angle, 
  2373. X+        X11_justify_text, line_and_point, do_arrow}
  2374. X+     ,{"X11", "X11 Window System - multi-color points",
  2375. X+        X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR, 
  2376. X+        X11_VTIC, X11_HTIC, X11_init, X11_reset, 
  2377. X+        X11_text, null_scale, X11_graphics, X11_move, X11_vector, 
  2378. X+        X11_linetype, X11_put_text, null_text_angle, 
  2379. X+        X11_justify_text, do_point, do_arrow}
  2380. X+ #endif
  2381. X  };
  2382. X  
  2383. X  #define TERMCOUNT (sizeof(term_tbl)/sizeof(struct termentry))
  2384. X***************
  2385. X*** 985,990
  2386. X              case 4 : term_name = "egalib";
  2387. X                       break;
  2388. X              case 7 : term_name = "hercules";
  2389. X                       break;
  2390. X              case 9 : term_name = "vgalib";
  2391. X                       break;
  2392. X
  2393. X--- 1091,1098 -----
  2394. X              case 4 : term_name = "egalib";
  2395. X                       break;
  2396. X              case 7 : term_name = "hercules";
  2397. X+                      break;
  2398. X+             case 8 : term_name = "att";
  2399. X                       break;
  2400. X              case 9 : term_name = "vgalib";
  2401. X                       break;
  2402. X*** ./gnuplot_x11.c    Thu Sep  6 09:22:16 1990
  2403. X--- ../patch1/gnuplot_x11.c    Wed Sep  5 21:25:26 1990
  2404. X***************
  2405. X*** 0
  2406. X
  2407. X--- 1,241 -----
  2408. X+ /*-----------------------------------------------------------------------------
  2409. X+  *
  2410. X+  *   gnuplot_x11 - X11 outboard terminal driver for gnuplot 2
  2411. X+  *
  2412. X+  *   Requires installation of companion inboard x11 driver in gnuplot/term.c
  2413. X+  *
  2414. X+  *   Acknowledgements: 
  2415. X+  *      Chris Peterson (MIT) - original Xlib gnuplot support (and Xaw examples)
  2416. X+  *      Dana Chee (Bellcore)  - mods to original support for gnuplot 2.0
  2417. X+  *      Arthur Smith (Cornell) - graphical-label-widget idea (xplot)
  2418. X+  *
  2419. X+  *   This code is provided as is and with no warranties of any kind.
  2420. X+  *       
  2421. X+  *   Ed Kubaitis
  2422. X+  *   Computing Services Office -  University of Illinois, Urbana
  2423. X+  *---------------------------------------------------------------------------*/
  2424. X+  
  2425. X+ #include <stdio.h>
  2426. X+ #include <X11/Intrinsic.h>
  2427. X+ #include <X11/StringDefs.h>
  2428. X+ #include <Cardinals.h>      /* use -Idir for location on your system */
  2429. X+ #include <Label.h>          /* use -Idir for location on your system */
  2430. X+ 
  2431. X+ 
  2432. X+ #define Color (D>1)
  2433. X+ #define Ncolors 11
  2434. X+ unsigned long colors[Ncolors];
  2435. X+ char color_keys[Ncolors][30] =   { "text", "border", "axis", 
  2436. X+    "line1", "line2", "line3", "line4", "line5", "line6", "line7", "line8" };
  2437. X+ 
  2438. X+ char color_values[Ncolors][30] = { "black", "black", "black", 
  2439. X+    "red",  "green", "blue",  "magenta", "cyan", "sienna", "orange", "coral" };
  2440. X+ 
  2441. X+ char dashes[10][5] = { {0}, {1,6,0}, 
  2442. X+    {0}, {4,2,0}, {1,3,0}, {4,4,0}, {1,5,0}, {4,4,4,1,0}, {4,2,0}, {1,3,0}
  2443. X+    };
  2444. X+ 
  2445. X+ Widget w_top, w_label;
  2446. X+ Window win;  Display *dpy;
  2447. X+ Pixmap pixmap;  GC gc = (GC)NULL;
  2448. X+ XFontStruct *font;
  2449. X+ unsigned long fg, bg;
  2450. X+ Dimension W = 640 , H = 450;  int D;
  2451. X+ Arg args[5];
  2452. X+ static void gnuplot(), resize();
  2453. X+ 
  2454. X+ int cx=0, cy=0, vchar, nc = 0;
  2455. X+ double xscale, yscale;
  2456. X+ #define X(x) (Dimension) (x * xscale)
  2457. X+ #define Y(y) (Dimension) ((4095-y) * yscale)
  2458. X+ enum JUSTIFY { LEFT, CENTRE, RIGHT } jmode;
  2459. X+ #define Nbuf 1024
  2460. X+ char buf[Nbuf];
  2461. X+ String *commands = NULL;
  2462. X+ 
  2463. X+ /*-----------------------------------------------------------------------------
  2464. X+  *   main program - fire up application and callbacks
  2465. X+  *---------------------------------------------------------------------------*/
  2466. X+ 
  2467. X+ main(argc, argv) int argc; char *argv[]; {
  2468. X+ 
  2469. X+    /* initialize application */
  2470. X+    w_top = XtInitialize("gnuplot", "Gnuplot", NULL, 0, &argc, argv);
  2471. X+    XtSetArg(args[0], XtNwidth, W);
  2472. X+    XtSetArg(args[1], XtNheight, H);
  2473. X+    w_label = XtCreateManagedWidget("", labelWidgetClass, w_top, args, TWO);
  2474. X+    XtRealizeWidget(w_top);
  2475. X+ 
  2476. X+    /* extract needed information */
  2477. X+    dpy = XtDisplay(w_top); win = XtWindow(w_top); D = DisplayPlanes(dpy,0);
  2478. X+    if (Color) {
  2479. X+       char option[20], *value; 
  2480. X+       XColor used, exact;
  2481. X+       int n;
  2482. X+ 
  2483. X+       for(n=0; n<Ncolors; n++) {
  2484. X+      strcpy(option, color_keys[n]);
  2485. X+      strcat(option, "Color");
  2486. X+      value = XGetDefault(dpy, "gnuplot", option);
  2487. X+      if (!value) { value = color_values[n]; }
  2488. X+      if (XAllocNamedColor(dpy, DefaultColormap(dpy,0), value, &used,&exact))
  2489. X+         colors[n] = used.pixel; 
  2490. X+      else {
  2491. X+         fprintf(stderr, "gnuplot: cannot allocate %s:%s\n", option, value);
  2492. X+         fprintf(stderr, "gnuplot: assuming %s:black\n", option);
  2493. X+         colors[n] = BlackPixel(dpy,0);
  2494. X+         }
  2495. X+      }
  2496. X+       }
  2497. X+    XtSetArg(args[0], XtNfont, &font);
  2498. X+    XtSetArg(args[1], XtNforeground, &fg);
  2499. X+    XtSetArg(args[2], XtNbackground, &bg);
  2500. X+    XtSetArg(args[3], XtNwidth, &W);
  2501. X+    XtSetArg(args[4], XtNheight,&H);
  2502. X+    XtGetValues(w_label, args, FIVE);
  2503. X+    vchar = (font->ascent + font->descent);
  2504. X+ 
  2505. X+    /* add callbacks on input-from-gnuplot-on-stdin & window-resized */
  2506. X+    XtAddInput(0, XtInputReadMask, gnuplot, NULL);
  2507. X+    XtAddEventHandler(w_label, StructureNotifyMask, FALSE, resize, NULL);
  2508. X+ 
  2509. X+    XtMainLoop();
  2510. X+    }
  2511. X+ 
  2512. X+ /*-----------------------------------------------------------------------------
  2513. X+  *   display - display accumulated commands from inboard driver
  2514. X+  *---------------------------------------------------------------------------*/
  2515. X+ 
  2516. X+ display() {
  2517. X+    int n, x, y, sw, sl, lt, width, type;
  2518. X+    char *buf, *str;
  2519. X+ 
  2520. X+    /* set scaling factor between internal driver & window geometry */
  2521. X+    xscale = (double)W / 4096.;  yscale = (double)H / 4096.;  
  2522. X+ 
  2523. X+    /* return old pixmap  & GC, if any */
  2524. X+    if (gc) { XFreeGC(dpy, gc); XFreePixmap(dpy, pixmap); }
  2525. X+ 
  2526. X+    /* create new pixmap & GC */
  2527. X+    pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy), W, H, D);
  2528. X+    gc = XCreateGC(dpy, pixmap, 0, NULL);
  2529. X+    XSetFont(dpy, gc, font->fid);
  2530. X+ 
  2531. X+    /* connect new pixmap to label widget */
  2532. X+    XtSetArg(args[0], XtNbitmap, pixmap);
  2533. X+    XtSetValues(w_label, args, ONE);
  2534. X+ 
  2535. X+    /* erase pixmap */
  2536. X+    if (Color) {
  2537. X+       XSetForeground(dpy, gc, bg);
  2538. X+       XFillRectangle(dpy, pixmap, gc, 0, 0, W, H);
  2539. X+       XSetForeground(dpy, gc, fg);
  2540. X+       XSetBackground(dpy, gc, bg);
  2541. X+       }
  2542. X+    else {
  2543. X+       XSetFunction(dpy, gc, GXxor);
  2544. X+       XCopyArea(dpy, pixmap, pixmap, gc, 0, 0, W, H, 0, 0);
  2545. X+       XSetFunction(dpy, gc, GXcopyInverted);
  2546. X+       }
  2547. X+ 
  2548. X+    /* loop over accumulated commands from inboard driver */
  2549. X+    for (n=0; n<nc; n++) {
  2550. X+       buf = commands[n];
  2551. X+ 
  2552. X+       /*   X11_vector(x,y) - draw vector  */
  2553. X+       if (*buf == 'V') { 
  2554. X+      sscanf(buf, "V%4d%4d", &x, &y);  
  2555. X+      XDrawLine(dpy, pixmap, gc, X(cx), Y(cy), X(x), Y(y));
  2556. X+      cx = x; cy = y;
  2557. X+      }
  2558. X+ 
  2559. X+       /*   X11_move(x,y) - move  */
  2560. X+       else if (*buf == 'M') 
  2561. X+      sscanf(buf, "M%4d%4d", &cx, &cy);  
  2562. X+ 
  2563. X+       /*   X11_put_text(x,y,str) - draw text   */
  2564. X+       else if (*buf == 'T') { 
  2565. X+      sscanf(buf, "T%4d%4d", &x, &y);  
  2566. X+      str = buf + 9; sl = strlen(str) - 1;
  2567. X+      sw = XTextWidth(font, str, sl);
  2568. X+      switch(jmode) {
  2569. X+         case LEFT:   sw = 0;     break;
  2570. X+         case CENTRE: sw = -sw/2; break;
  2571. X+         case RIGHT:  sw = -sw;   break;
  2572. X+         }
  2573. X+      if (!Color) 
  2574. X+         XDrawString(dpy, pixmap, gc, X(x)+sw, Y(y)+vchar/3, str, sl);
  2575. X+      else { 
  2576. X+         XSetForeground(dpy, gc, colors[0]);
  2577. X+         XDrawString(dpy, pixmap, gc, X(x)+sw, Y(y)+vchar/3, str, sl);
  2578. X+         XSetForeground(dpy, gc, colors[lt+1]);
  2579. X+         }
  2580. X+      }
  2581. X+ 
  2582. X+       /*   X11_justify_text(mode) - set text justification mode  */
  2583. X+       else if (*buf == 'J') 
  2584. X+      sscanf(buf, "J%4d", &jmode);
  2585. X+ 
  2586. X+       /*   X11_linetype(type) - set line type  */
  2587. X+       else if (*buf == 'L') { 
  2588. X+      sscanf(buf, "L%4d", <);
  2589. X+      lt = (lt+2)%10;
  2590. X+      width = (lt == 0) ? 2 : 0;
  2591. X+      if (Color) {
  2592. X+         if (lt != 1) 
  2593. X+            type = LineSolid;
  2594. X+         else {
  2595. X+            type = LineOnOffDash;
  2596. X+            XSetDashes(dpy, gc, 0, dashes[lt], strlen(dashes[lt]));
  2597. X+            }
  2598. X+         XSetForeground(dpy, gc, colors[lt+1]);
  2599. X+         }
  2600. X+      else {
  2601. X+         type  = (lt == 0 || lt == 2) ? LineSolid : LineOnOffDash;
  2602. X+         if (dashes[lt][0])
  2603. X+            XSetDashes(dpy, gc, 0, dashes[lt], strlen(dashes[lt]));
  2604. X+         }
  2605. X+      XSetLineAttributes( dpy,gc, width, type, CapButt, JoinBevel);
  2606. X+      }
  2607. X+       }
  2608. X+ 
  2609. X+    /* trigger expose events to display pixmap */
  2610. X+    XClearArea(dpy, win, 0, 0, 0, 0, True);
  2611. X+    }
  2612. X+ 
  2613. X+ /*-----------------------------------------------------------------------------
  2614. X+  *   gnuplot - Xt callback on input from gnuplot inboard X11 driver
  2615. X+  *---------------------------------------------------------------------------*/
  2616. X+ 
  2617. X+ static void
  2618. X+ gnuplot(cd, s, id) char *cd; int *s; XtInputId *id; {
  2619. X+ 
  2620. X+    while (fgets(buf, Nbuf, stdin)) {
  2621. X+      if (*buf == 'G') {                           /* enter graphics mode */
  2622. X+      if (commands) {
  2623. X+         int n;
  2624. X+         for (n=0; n<nc; n++) XtFree(commands[n]);
  2625. X+         XtFree(commands);
  2626. X+         }
  2627. X+      commands = NULL; nc = 0;
  2628. X+          }
  2629. X+       else if (*buf == 'E') { display(); break; } /* leave graphics mode */
  2630. X+       else if (*buf == 'R') { exit(0); }          /* leave X11/x11 mode  */
  2631. X+       else {
  2632. X+      commands = (String *)XtRealloc(commands, (nc+1) * sizeof(String));
  2633. X+      commands[nc++] = XtNewString(buf);
  2634. X+      }
  2635. X+       }
  2636. X+    if (feof(stdin) || ferror(stdin)) exit(0);
  2637. X+    }
  2638. X+ 
  2639. X+ /*-----------------------------------------------------------------------------
  2640. X+  *   resize - Xt callback when window resized
  2641. X+  *---------------------------------------------------------------------------*/
  2642. X+ 
  2643. X+ static void
  2644. X+ resize(w, cd, e) Widget w; char *cd; XConfigureEvent *e; {
  2645. X+    if (e->type != ConfigureNotify) return;
  2646. X+    W = e->width; H = e->height;
  2647. X+    display(); 
  2648. X+    }
  2649. END_OF_patch1c
  2650. if test 73914 -ne `wc -c <patch1c`; then
  2651.     echo shar: \"patch1c\" unpacked with wrong size!
  2652. fi
  2653. # end of overwriting check
  2654. fi
  2655. echo shar: End of shell archive.
  2656. exit 0
  2657.  
  2658.